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.
Alien/Alien.h@9:759b419fec3b, 2020-05-26 (annotated)
- Committer:
- MatisRequis
- Date:
- Tue May 26 07:26:13 2020 +0000
- Revision:
- 9:759b419fec3b
- Child:
- 10:2ae9d4145410
Aliens working similar to bullets with random
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MatisRequis | 9:759b419fec3b | 1 | #ifndef Alien_H |
MatisRequis | 9:759b419fec3b | 2 | #define Alien_H |
MatisRequis | 9:759b419fec3b | 3 | |
MatisRequis | 9:759b419fec3b | 4 | #include "mbed.h" |
MatisRequis | 9:759b419fec3b | 5 | #include "N5110.h" |
MatisRequis | 9:759b419fec3b | 6 | #include "Gamepad.h" |
MatisRequis | 9:759b419fec3b | 7 | #include "Board.h" |
MatisRequis | 9:759b419fec3b | 8 | |
MatisRequis | 9:759b419fec3b | 9 | #include <cstdlib> |
MatisRequis | 9:759b419fec3b | 10 | #include <ctime> |
MatisRequis | 9:759b419fec3b | 11 | |
MatisRequis | 9:759b419fec3b | 12 | |
MatisRequis | 9:759b419fec3b | 13 | class Alien { |
MatisRequis | 9:759b419fec3b | 14 | public: |
MatisRequis | 9:759b419fec3b | 15 | Alien(); |
MatisRequis | 9:759b419fec3b | 16 | ~Alien(); |
MatisRequis | 9:759b419fec3b | 17 | void init(int column, int speed); |
MatisRequis | 9:759b419fec3b | 18 | void draw(N5110 &lcd); |
MatisRequis | 9:759b419fec3b | 19 | void update(); |
MatisRequis | 9:759b419fec3b | 20 | int checkdelete(); |
MatisRequis | 9:759b419fec3b | 21 | int checkobjective(); |
MatisRequis | 9:759b419fec3b | 22 | Vector2D getxy(); |
MatisRequis | 9:759b419fec3b | 23 | |
MatisRequis | 9:759b419fec3b | 24 | private: |
MatisRequis | 9:759b419fec3b | 25 | int _size; |
MatisRequis | 9:759b419fec3b | 26 | int _column; |
MatisRequis | 9:759b419fec3b | 27 | int _x; |
MatisRequis | 9:759b419fec3b | 28 | int _y; |
MatisRequis | 9:759b419fec3b | 29 | Board _board; |
MatisRequis | 9:759b419fec3b | 30 | int _currentpos; |
MatisRequis | 9:759b419fec3b | 31 | int _rand; |
MatisRequis | 9:759b419fec3b | 32 | int _loss; |
MatisRequis | 9:759b419fec3b | 33 | int _movcount; |
MatisRequis | 9:759b419fec3b | 34 | int _alienspeed; |
MatisRequis | 9:759b419fec3b | 35 | }; |
MatisRequis | 9:759b419fec3b | 36 | #endif |