Arturs Kozlovskis / Mbed 2 deprecated ELEC2645_Project_el18ak

Dependencies:   mbed

Revision:
16:e2aaef863d7c
Parent:
14:739115711bf8
Child:
18:8f7291885e19
--- a/My_game_clases/Objects.cpp	Fri May 01 12:54:25 2020 +0000
+++ b/My_game_clases/Objects.cpp	Thu May 07 08:58:21 2020 +0000
@@ -51,19 +51,23 @@
     lcd.drawSprite(_cannon_pos,40,6,6,(int *)_cannon);
 
 }
-void Objects::draw_shots(N5110 &lcd,Gamepad &pad)
+void Objects::draw_shots(N5110 &lcd,Gamepad &pad, bool c)
 {
 
     for (int i = 0; i < _shot_y_pos.size(); i++) {
         lcd.drawRect(_shot_x_pos[i],_shot_y_pos[i],2,2,FILL_BLACK);
-        // printf( " %d || %d \n",_shot_x_pos.size(),_shot_y_pos.size());
-        _shot_y_pos[i] -= _shot_incrementer; // moves the shots upwards
+        //printf( " %d || %d \n",_shot_x_pos.size(),_shot_y_pos.size());
+        //if(c == true) {
+            _shot_y_pos[i] -= _shot_incrementer; // moves the shots upwards
+        //} else {
+        //    _shot_y_pos[i] = _shot_y_pos[i];
+        //}
     }
 
     //adds another shot if the distance between
     //y pos of the initial pos and previous shot pos is more than 7
     if(_shot_y_pos[_shot_y_pos.size() - 1 ] + 7 < _initial_shot_pos || _shot_y_pos.size() < 1) {
-        if(pad.A_held()) {
+        if(pad.X_held()) {
             _shot_y_pos.push_back(_initial_shot_pos);
             _shot_x_pos.push_back(_cannon_pos + 2);
         }