Matis Requis 201241242
Dependencies: mbed
Tempest Game
Game Screen
The board is made of 12 columns. The Hero stays at the top of the column
Game Controls
To control the hero spaceship point the joystick to the column you want the hero to go to.
Press the A button to shoot a bullet in the column you are currently in.
Hero/Hero.h@4:8e3ba8d6d915, 2020-05-22 (annotated)
- Committer:
- MatisRequis
- Date:
- Fri May 22 10:29:49 2020 +0000
- Revision:
- 4:8e3ba8d6d915
- Parent:
- 2:d59a92e65bd9
- Child:
- 6:037dfa5064a1
Hero movement done, now depends on joystick position
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MatisRequis | 2:d59a92e65bd9 | 1 | #ifndef HERO_H |
MatisRequis | 2:d59a92e65bd9 | 2 | #define HERO_H |
MatisRequis | 2:d59a92e65bd9 | 3 | |
MatisRequis | 2:d59a92e65bd9 | 4 | #include "mbed.h" |
MatisRequis | 2:d59a92e65bd9 | 5 | #include "N5110.h" |
MatisRequis | 2:d59a92e65bd9 | 6 | #include "Gamepad.h" |
MatisRequis | 2:d59a92e65bd9 | 7 | |
MatisRequis | 2:d59a92e65bd9 | 8 | class Hero { |
MatisRequis | 2:d59a92e65bd9 | 9 | |
MatisRequis | 2:d59a92e65bd9 | 10 | public: |
MatisRequis | 2:d59a92e65bd9 | 11 | |
MatisRequis | 2:d59a92e65bd9 | 12 | Hero(); |
MatisRequis | 2:d59a92e65bd9 | 13 | ~Hero(); |
MatisRequis | 2:d59a92e65bd9 | 14 | |
MatisRequis | 2:d59a92e65bd9 | 15 | void init(int column); |
MatisRequis | 2:d59a92e65bd9 | 16 | void draw(N5110 &lcd); |
MatisRequis | 4:8e3ba8d6d915 | 17 | void update(float d, float mag, int a); |
MatisRequis | 2:d59a92e65bd9 | 18 | Vector2D getxy(); |
MatisRequis | 2:d59a92e65bd9 | 19 | int _column; |
MatisRequis | 2:d59a92e65bd9 | 20 | |
MatisRequis | 2:d59a92e65bd9 | 21 | private: |
MatisRequis | 2:d59a92e65bd9 | 22 | |
MatisRequis | 2:d59a92e65bd9 | 23 | |
MatisRequis | 2:d59a92e65bd9 | 24 | int _x; |
MatisRequis | 2:d59a92e65bd9 | 25 | int _y; |
MatisRequis | 4:8e3ba8d6d915 | 26 | int _a; |
MatisRequis | 4:8e3ba8d6d915 | 27 | int _d; |
MatisRequis | 4:8e3ba8d6d915 | 28 | int _mag; |
MatisRequis | 2:d59a92e65bd9 | 29 | |
MatisRequis | 2:d59a92e65bd9 | 30 | }; |
MatisRequis | 2:d59a92e65bd9 | 31 | #endif |