ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

Revision:
2:6c1d7aa20e81
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SpaceInvadersEngine/SpaceInvadersEngine.h	Wed Apr 03 15:37:52 2019 +0000
@@ -0,0 +1,29 @@
+#ifndef SPACEINVADERS_H
+#define SPACEINVADERS_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+
+
+// gap from edge of screen
+#define GAP 2
+class SpaceInvaders
+{
+
+public:
+    SpaceInvadersEngine();
+    ~SpaceInvadersEngine();
+    
+    void init(int paddle_width,int paddle_height,int ball_size,int speed);
+    void read_input(Gamepad &pad);
+    void update(Gamepad &pad);
+    void draw(N5110 &lcd);
+    
+private:
+
+    void check_wall_collision(Gamepad &pad);
+    void check_paddle_collisions(Gamepad &pad);
+    void check_goal(Gamepad &pad);
+    void print_scores(N5110 &lcd);
+    
\ No newline at end of file