Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed N5110 ShiftReg PinDetect
Game.h
- Committer:
- Siriagus
- Date:
- 2015-05-02
- Revision:
- 8:9ac6a428fa26
- Parent:
- 7:678873947b29
- Child:
- 9:da608ae65df9
File content as of revision 8:9ac6a428fa26:
#ifndef GAME_H
#define GAME_H
#include "State.h"
#include "Resources.h" // TODO: Move to State.h ?
#include <vector>
struct Object
{
int x, y, width, height;
int vx, vy;
bool onGround;
};
struct Point
{
int x;
int y;
};
class Game : public State
{
public:
Game(StateManager* fsm, N5110 *lcd, InputManager* input)
: State(fsm, lcd, input) {player.x = 10; player.y = 10; player.width = 5; player.height = 5; player.vy = 0; player.vx = 0; player.onGround = false; init();}
virtual void update(float dt);
virtual void render();
void init();
private:
Object player;
static void btnAPress();
static void btnBPress();
static bool btnAPressed;
static bool btnBPressed;
// Buttons interrupts
std::vector<Point*> bullets;
};
#endif