Matis Requis 201241242

Dependencies:   mbed

Tempest Game

Game Screen

https://os.mbed.com/media/uploads/MatisRequis/tempest_board_wiki.png The board is made of 12 columns. The Hero stays at the top of the column

Game Controls

https://os.mbed.com/media/uploads/MatisRequis/gamepad_buttons.png

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.

Revision:
4:8e3ba8d6d915
Parent:
3:54132cf073d7
Child:
6:037dfa5064a1
--- a/TempestEngine/TempestEngine.cpp	Thu May 21 07:10:22 2020 +0000
+++ b/TempestEngine/TempestEngine.cpp	Fri May 22 10:29:49 2020 +0000
@@ -9,23 +9,22 @@
 }
 
 
-void TempestEngine::init(int column_amount, int bullet_speed) {
-    
+void TempestEngine::init() {
+    _hero.init(0);
     }
     
-void TempestEngine::readinput(Gamepad &pad) {
-    _d = pad.get_direction();
-    _a = pad.A_pressed();
-    }
-    
+
 void TempestEngine::draw(N5110 &lcd) {
     _board.draw(lcd);
+    
+    //draw hero ship
+    _hero.draw(lcd);
+    
     /*
     //score
     print_score(lcd);
     
-    //draw hero ship
-    _hero.draw(lcd);
+
     
     //draw ennemies
     _ennemy.draw(lcd);
@@ -33,4 +32,14 @@
     //draw bullets
     _bullet.draw(lcd); */
     
-    }
\ No newline at end of file
+    }
+void TempestEngine::read_input(Gamepad &pad) {
+    _d = pad.get_angle();
+    _mag = pad.get_mag();   
+    _a = pad.A_pressed();
+}
+
+
+void TempestEngine::update() {
+    _hero.update(_d, _mag, _a);   
+}
\ No newline at end of file