2016-03-28 13:05:18 +00:00
|
|
|
#ifndef __PTF_GAME_HPP__
|
|
|
|
#define __PTF_GAME_HPP__
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
2016-03-26 09:08:13 +00:00
|
|
|
#include <SFML/Audio.hpp>
|
2016-03-08 18:51:42 +00:00
|
|
|
#include "object.hpp"
|
2016-03-13 16:03:56 +00:00
|
|
|
#include "engine_state.hpp"
|
2016-03-22 19:04:18 +00:00
|
|
|
#include "resource_manager.hpp"
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
/**
|
2016-03-28 13:05:18 +00:00
|
|
|
* La classe Game gère l'affichage et les objets
|
|
|
|
* d'une partie de jeu
|
2016-03-04 15:29:31 +00:00
|
|
|
*/
|
2016-03-28 13:05:18 +00:00
|
|
|
class Game {
|
2016-03-04 15:29:31 +00:00
|
|
|
private:
|
|
|
|
sf::Clock clock;
|
|
|
|
sf::RenderWindow window;
|
2016-03-22 19:04:18 +00:00
|
|
|
sf::View view;
|
2016-03-26 09:08:13 +00:00
|
|
|
sf::Music music;
|
2016-03-22 19:04:18 +00:00
|
|
|
|
2016-03-13 16:03:56 +00:00
|
|
|
EngineState state;
|
2016-03-22 19:04:18 +00:00
|
|
|
ResourceManager resources;
|
2016-03-08 18:51:42 +00:00
|
|
|
|
2016-03-09 18:35:40 +00:00
|
|
|
/**
|
|
|
|
* Met à jour les objets du jeu pour
|
2016-03-28 13:05:18 +00:00
|
|
|
* qu'ils s'adaptent au nouvel état
|
2016-03-09 18:35:40 +00:00
|
|
|
*/
|
|
|
|
void update();
|
2016-03-08 18:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dessine la scène du jeu couche par couche
|
|
|
|
*/
|
2016-03-04 15:29:31 +00:00
|
|
|
void draw();
|
2016-03-08 18:51:42 +00:00
|
|
|
|
2016-03-09 18:35:40 +00:00
|
|
|
public:
|
2016-03-28 13:05:18 +00:00
|
|
|
Game();
|
2016-03-09 18:35:40 +00:00
|
|
|
|
2016-03-08 18:51:42 +00:00
|
|
|
/**
|
2016-03-09 18:35:40 +00:00
|
|
|
* Démarre la boucle principale du jeu
|
2016-03-08 18:51:42 +00:00
|
|
|
*/
|
2016-03-09 18:35:40 +00:00
|
|
|
void start();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ajoute un nouvel objet à la liste des objets du jeu
|
|
|
|
*/
|
2016-03-12 18:45:16 +00:00
|
|
|
void addObject(Object& object);
|
2016-03-04 15:29:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|