74 lines
993 B
C++
74 lines
993 B
C++
#ifndef GAME_HPP_INCLUDED
|
|
#define GAME_HPP_INCLUDED
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include <SDL/SDL.h>
|
|
#include <SDL/SDL_ttf.h>
|
|
|
|
#include "map.hpp"
|
|
#include "part.hpp"
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
class GameState;
|
|
|
|
class game
|
|
{
|
|
public:
|
|
game();
|
|
~game();
|
|
|
|
bool Init();
|
|
bool Load();
|
|
|
|
void ChangeState ( GameState * state );
|
|
void PushState ( GameState * state );
|
|
void PopState();
|
|
void DelStateF();
|
|
|
|
# ifdef DEBUG
|
|
int CountStates();
|
|
# endif
|
|
|
|
|
|
void HandleEvents();
|
|
void Update();
|
|
void Draw();
|
|
|
|
SDL_Surface * GetScreen();
|
|
Uint32 GetStart();
|
|
|
|
TTF_Font * GetfontMenu();
|
|
TTF_Font * GetfontGame();
|
|
|
|
void SetStart ( Uint32 start );
|
|
void SetRunning ( bool m_bRunning );
|
|
|
|
void Clean();
|
|
|
|
bool Running();
|
|
void Quit();
|
|
|
|
void ReduceFPS();
|
|
void UpdateFPS();
|
|
|
|
private:
|
|
SDL_Surface * m_pScreen;
|
|
vector <GameState *> states;
|
|
|
|
bool m_bRunning;
|
|
bool m_bGameOver;
|
|
|
|
TTF_Font * fontMenu;
|
|
TTF_Font * fontGame;
|
|
|
|
Uint32 start;
|
|
int tick;
|
|
};
|
|
|
|
|
|
#endif
|