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
Diff: Game.h
- Revision:
- 8:9ac6a428fa26
- Parent:
- 7:678873947b29
- Child:
- 9:da608ae65df9
--- a/Game.h Fri May 01 18:10:59 2015 +0000
+++ b/Game.h Sat May 02 00:22:43 2015 +0000
@@ -2,18 +2,43 @@
#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) {init();}
+ : 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:
- void init() {}
+ Object player;
+ static void btnAPress();
+ static void btnBPress();
+ static bool btnAPressed;
+ static bool btnBPressed;
+ // Buttons interrupts
+
+ std::vector<Point*> bullets;
};
#endif