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:
7:94bc3e21d664
Parent:
6:037dfa5064a1
Child:
8:5feb1913bc92
--- a/TempestEngine/TempestEngine.cpp	Mon May 25 07:46:48 2020 +0000
+++ b/TempestEngine/TempestEngine.cpp	Mon May 25 09:08:25 2020 +0000
@@ -19,11 +19,6 @@
     
     //draw hero ship
     _hero.draw(lcd);
-
-
-    
-    //draw ennemies
-//    _ennemy.draw(lcd);
     
     //draw bullets
     draw_bullets(lcd);
@@ -31,8 +26,8 @@
     }
 void TempestEngine::read_input(Gamepad &pad) {
     _d = pad.get_angle();
-    _mag = pad.get_mag();   
-    _a = pad.A_pressed();
+    _mag = pad.get_mag();
+    _a = pad.A_pressed();  
 }
 
 
@@ -42,24 +37,26 @@
 }
 
 void TempestEngine::create_bullets() {
-    if (_bullet_timer <= 0) {
-        if (_a == 1) {
+    //if (_bullet_timer <= 0) {
+        if (_a) {
             Bullet new_bullet;
             
             new_bullet.init(_hero.get_column());
             
             bullet_vect.push_back(new_bullet);
             
-            _bullet_timer = 5;  
+            //_bullet_timer = 5;  
         }
-    }  
-    _bullet_timer--;
+    //}  
+    //_bullet_timer--;
 }
 
+
 //draws all the bullets
 void TempestEngine::draw_bullets(N5110 &lcd) {
     //iterates through the bullet objects
     for (int i = 0; i< bullet_vect.size(); i++) {
+        bullet_vect[i].update();   
         //draws current bullet
         bullet_vect[i].draw(lcd);