Giter Club home page Giter Club logo

cpp-arcade-spec's Introduction

C++ Module: Arcade Protocol Specification

This document covers the interfaces and the protocol between the Graphics libraries and the Game libraries in the context of the EPITECH C++ Arcade project.

If you are going to implement this specification, please pay attention to not modify any class or enum names and to keep those under the "Arcade" namespace.

Entry Point

Your function for the entry point of the library must be named entryPoint

Utilities

The protocol will be referring to a few primitives for representing things like Vectors and Colors.
This section describes their prototypes.

Files: Vect.hpp / Color.hpp / Keys.hpp

Graphic Library / Game Library interoperability

This sections describes objects that will be common for both the graphics libraries and the game libraries.

Files: PixelBox.hpp / TextBox.hpp

Graphics Libraries

This section describes the API that each graphics library should inherit, implement and expose.

Files: IGraphicLib.hpp

Game Libraries

This section describes the API that each game library should inherit, implement and expose.

Files: IGameLib.hpp

cpp-arcade-spec's People

Contributors

arthurknoep avatar cedricthomas avatar hirevo avatar mqje avatar thibautcornolti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cpp-arcade-spec's Issues

Percentage

For the PixelBox, I think the best way to handle it is to use percentage in dimensions.

For example, in sfml the unit are 1920 * 1080 for the creation of the window, in libcaca the unit are 80 * 40 for the creation of the window (it's not pixel, it's character). If we use percentage in the size and the position of the PixelBox, we can handle this sitution without any problem.

PixelBox coordinates ?

-> Vect<size_t> _pos
Do we implicitely say that the first value is the 'X' coordinate and the 2nd value de 'Y' ? Or should we convert this to a map ?

Where to Link/Compile our functions for PixelBox, Color&co ?

We have the prototypes for all the general functions that should be common to all libraries but how should we compile them ?

Should we add them to the sources of our main arcade binairy ?
Should it be in a common.so library that would be required at launch ? (some may have more optimized versions and implementations)

Discuss...

Remove loadTextFont

I don't understand the goal behind this function:

		virtual void *loadTextFont(std::string path) = 0;

I never encountered a game that allow us to change a font ingame.

Please enlighten me!

Major Problem

I have my current LibNCurses Class which is inheriting from Arcade::IGraphicLib, like this ๐Ÿ‘

class LibNCurses : public Arcade::IGraphicLib {
	public:
		LibNCurses();
		~LibNCurses();
}

But when i'm trying to compile after having declared all functions marked as virtual, I'm still having a problem with the destructor, which produces this error :

/tmp/ccvsUt8i.o: In function `Arcade::LibNCurses::LibNCurses()':
source.cpp:(.text+0x83): undefined reference to `Arcade::IGraphicLib::~IGraphicLib()'
/tmp/ccvsUt8i.o: In function `Arcade::LibNCurses::~LibNCurses()':
source.cpp:(.text+0xcc): undefined reference to `Arcade::IGraphicLib::~IGraphicLib()'
collect2: error: ld returned 1 exit status

This happens even though I have the declared the destructor for Arcade::LibNCurses.
The problem is that it still somehow requires a destructor to exist for IGraphicLib. The only way I've found is to change this :

virtual ~IGraphicLib() = 0;

to this :

virtual ~IGraphicLib() {};

Coding Style

In the contructor of TextBox we use 5 arguments, which is forbidden by the coding style.

Same for Color

Saving Scores

Since our applications are supposed to run between groups, we should also try to save the scores for the different users in the same locations and using the same file format/syntax.

Since we won't try to parse JSON or CSV, we could maybe store them in ~/.arcade/$GAMENAME.scores such as :

Ratouney:420
MemeDude:69
PoloRalphLauren:42

(it could also be usefull to keep them ordered from top to bottom, depending on how many entries in the Top3, Top5 or any else the user wants to display)

Let's vote about PixelBox!

Would you rather do:

  • A vector of pixel to handle the pixels of the box

    • Better for the memory
    • Vector must be converted for each resize
  • A map with x, y as key and the pixel of the box as value

    • No conversion when resizing and code very easy

PLEASE VOTE AND COMMENT

Text size handling

We are handling the text size with height and width. How do we convert that in a font size value?

Menu navigation

Hi,

I'm asking myself how does the menu work, is it better to click or to navigate with the keyboard?

Missing handling of low level graphiclib

I was trying to implement the ncruses lib, and I noticed that something is missing.
There is no sprite in ncruses, so I would like to create a subClass for the PixelPox named Pixel including a char and its color

Input Text

In the subject it's write we need to ask the name of the player in the main menu

How can we handle that with the current implementation of IGraphicLib ?

Const GetName Const

PLEASE WRITE YOUR ISSUE IN LEGIBLE ENGLISH (ANY NON-ENGLISH ISSUE WILL BE DISCARDED)

For both library, can we change :
virtual std::string getName() = 0;
to :
virtual const std::string getName() const = 0;
?

About standardizing DLLoader

About standardizing DLLoader

Should we write a common interface for the DLLoader class, or do we implement it on our own ?

How is the PutPixel method supposed to work ?

		void putPixel(Vect<size_t> pos, Color col);
		Color getPixel(Vect<size_t> pos) const;

		void putRect(Vect<size_t> pos, Vect<size_t> size, Color col);

		std::vector<Color> &getPixelArray();

	private:
		std::vector<Color> _colorFrame;

How are we supposed to store the separate pixels in a vector containing only colors ?
Are we supposed to create our own personnal buffer/map to store at which position we have each color ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.