2016 Epitech Project

Usage

In this project, you will have to create a gaming platform. This platform have
to include games and must be able to run with differents GUI. Games
and GUIs will be in dynamic loaded libraries. You have to choose between a little set of games and another little set of graphic libraries

./arcade lib/lib_arcade_[NAME].so

Graphic lib Name:

The graphic libs is store in lib folder

Games lib Name:

The games is store in games folder

Key:

KEY CMD DESCRIPTION
Quit Echap Exit the game and the luncher
PLAY Enter/p Run the selected game
MENU 9 return to the luncher menu
RGAME 8 restart the selected game
PGAME 4 previous selected game
NGAME 5 next selected game
PLIB 2 previous selected grapic library
NLIB 3 next selected graphic library
GO_UP Arrow UP player go up in game
GO_DOWN Arrow DOWN player go down in game
GO_RIGHT Arrow RIGHT player go right in game
GO_LEFT Arrow LEFT player got left in game

Structure

Global Structure

IGAMES INTERFACE:

IGRAPH INTERFACE:

Graphic Interface (API)

The graphic interface is used by games for write the map in the screen, get the player events and manage the screen.

CreatLib:

The function create the graphic object.

extern "C" IGraph  *creatLib();

openWindow:

The function open window.

bool    openWindow(int xSize, int ysize, std::string name);
Parameters:

closeWindow:

The function close window.

bool    closeWindow();

SetBox:

The function is used to write a tile of the map to the screen.

bool    setBox(int x,
               int y,
               games::TileType status,
               games::TileDirection direction);
Parameters:

SetEvent:

The functon associate a void function to a event key.

bool    setEvent(games::CommandType key, void (*fct)(void *));
Parameters:

checkEvent:

The function check press key and call associate function.

bool    checkEvent(void *data);
Parameters:

refreshScreen:

The function write the new screeen.

bool    refreshScreen();

printStr:

The function write a string to screen.

bool    printStr(int x, int y, std::string str);
Parameters:

Games Interface (API)

CreatGame:

The function create the game object.

extern "C" IGames *creatGame(IGraph *graphic);
Parameters:

move:

The function execute one movement of the logic games deplacement.

void  move();

run:

The function run the game.

int  run();

getName:

The function get the name of game.

  virtual std::string getName();

Arcade Enums

games::TileType

abbrevation of SolarFox is SFX
abbrevation of Snake is SNK

games::CommandType

games::TileDirection

File Tree

├── Makefile
├── README.md
├── games
├── include
│   ├── Arcade.hh
│   ├── Luncher.hh
│   ├── Protocol.hpp
│   ├── Translator.hh
│   ├── games
│   │   ├── IGames.hh
│   │   ├── Snake.hh
│   │   ├── SolarFox.hh
│   │   ├── snake
│   │   │   └── items
│   │   │       ├── Body.hh
│   │   │       ├── Food.hh
│   │   │       └── Item.hh
│   │   └── solarfox
│   │       ├── EnemyShoot.hh
│   │       ├── Obstacle.hh
│   │       ├── PowerUp.hh
│   │       ├── SFXHEnemy.hh
│   │       ├── SFXVEnemy.hh
│   │       ├── SpaceObject.hh
│   │       ├── SpaceShip.hh
│   │       └── SpaceShipShoot.hh
│   └── graphic
│       ├── IGraph.hh
│       ├── Libcaca.hh
│       └── SDL.hh
├── lib
├── src
│   ├── arcade.cpp
│   ├── games
│   │   ├── snake
│   │   │   ├── Snake.cpp
│   │   │   ├── items
│   │   │   │   ├── Body.cpp
│   │   │   │   ├── Food.cpp
│   │   │   │   └── Item.cpp
│   │   │   ├── protocol.cpp
│   │   │   └── snake.cpp
│   │   └── solarfox
│   │       ├── event.cpp
│   │       ├── logic.cpp
│   │       ├── protocol.cpp
│   │       ├── solarfox.cpp
│   │       └── spaceobject
│   │           ├── enemyshoot.cpp
│   │           ├── obstacle.cpp
│   │           ├── powerup.cpp
│   │           ├── sfxhenemy.cpp
│   │           ├── sfxvenemy.cpp
│   │           ├── spaceobject.cpp
│   │           ├── spaceship.cpp
│   │           └── spaceshipshoot.cpp
│   ├── graphic
│   │   ├── Libcaca.cpp
│   │   ├── SDL.cpp
│   │   ├── bmp
│   │   │   ├── BODY.bmp
│   │   │   ├── ENNEMY_SHOOT.bmp
│   │   │   ├── FOOD.bmp
│   │   │   ├── HEAD.bmp
│   │   │   ├── MY_SHOOT.bmp
│   │   │   ├── SPACESHIP.bmp
│   │   │   ├── SPI_ENNEMY.bmp
│   │   │   └── SPI_VENEMY.bmp
│   │   └── font
│   │       ├── README.md
│   │       ├── arcadeISO8859-1.bdf
│   │       ├── arcadeISO8859-1.pcf
│   │       ├── fonts.dir
│   │       ├── install
│   │       └── skrybylr.ttf
│   ├── luncher
│   │   ├── event.cpp
│   │   └── luncher.cpp
│   └── translator.cpp