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: SpaceRebEngine/SpaceRebEngine.h
- Revision:
- 4:d744920089ea
- Child:
- 5:0da65740cd5e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SpaceRebEngine/SpaceRebEngine.h Sun May 05 13:53:39 2019 +0000
@@ -0,0 +1,50 @@
+#ifndef SPACEREBENGINE_H
+#define SPACEREBENGINE_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+#include "Missiles.h"
+#include "SpaceInvader.h"
+
+// gap from edge of screen
+#define GAPx 2
+#define GAPy 2
+
+class SpaceRebEngine
+{
+
+public:
+ SpaceRebEngine();
+ ~SpaceRebEngine();
+
+ void init(int spaceinvader_width,int spaceinvader_height,int missiles_size,int speed);
+ void read_input(Gamepad &pad);
+ void update(Gamepad &pad);
+ void draw(N5110 &lcd);
+
+private:
+
+ void check_spaceinvader_collision(Gamepad &pad);
+ void print_level(N5110 &lcd);
+ void print_time (N5110 &lcd);
+
+ SpaceInvader _player;
+
+ int _spaceinvader_width;
+ int _spaceinvader_height;
+ int _missiles_size;
+ int _speed;
+
+ // x positions of the paddles
+ int _playerx;
+ int _playery;
+
+ Missiles _missiles;
+
+ Direction _d;
+ float _mag;
+
+};
+
+#endif
\ No newline at end of file