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
Diff: SpaceInvadersEngine/SpaceInvadersEngine.h
- Revision:
- 13:9d6ee753eca6
- Parent:
- 12:45b1249b3d9a
- Child:
- 31:5c9309ddf84c
--- a/SpaceInvadersEngine/SpaceInvadersEngine.h Mon Apr 15 14:36:07 2019 +0000
+++ b/SpaceInvadersEngine/SpaceInvadersEngine.h Fri Apr 19 17:33:57 2019 +0000
@@ -9,11 +9,7 @@
// gap from edge of screen
#define GAP 2
-extern int space_ship_width;
-extern int space_ship_height;
-extern int bullet_size;
-extern int alien_size;
-extern int speed;
+
class SpaceInvadersEngine
{
@@ -22,7 +18,7 @@
SpaceInvadersEngine();
~SpaceInvadersEngine();
- void init(int space_ship_width ,int space_ship_height,int bullet_size, int alien_size, int speed);
+ void init(int space_ship_width,int space_ship_height,int bullet_size, int alien_size,int speed);
void read_input(Gamepad &pad);
void update(Gamepad &pad);
void draw(N5110 &lcd);
@@ -31,13 +27,13 @@
private:
+
void check_wall_collision(Gamepad &pad);
void space_ship_collisions(Gamepad &pad);
void check_goal(Gamepad &pad);
void print_scores(N5110 &lcd);
- //Paddle _p1;
- //Paddle _p2;
+
int _space_ship_width;
int _space_ship_height;
@@ -45,17 +41,10 @@
int _alien_size;
int _speed;
-
-
- /* // x positions of the paddles
- int _p1x;
- int _p2x;
-
- Ball _ball;
-
Direction _d;
float _mag;
- */
+
+
};