treewars/game.h

48 lines
814 B
C++

/* This is the heart of the application - the main game state where we are
actually playing.
This contains the basic game logic.
*/
#ifndef _GAME_H_
#define _GAME_H_
#include "gamedata.h"
#include "gamestate.h"
#include <stack>
#include <SDL_ttf.h>
using std::stack;
class Game : public GameState
{
public:
Game(stack<GameState*>* state_stack, SDL_Surface* display);
~Game();
bool init();
protected:
void render();
void iterate() {}
// event handlers
void on_lbutton_down(int x, int y);
void on_rbutton_down(int mX, int mY);
void on_key_down(SDLKey sym, SDLMod mod, Uint16 unicode);
private:
// data
GameData data;
static int NODE_RADIUS;
// surfaces containing textures to draw
SDL_Surface* background;
TTF_Font* font;
};
#endif