Meteor defense project

Dependencies:   N5110 mbed

Revision:
29:6632dd9c48d8
Parent:
28:450ab72fabdc
Child:
30:2e2d48cbfec3
--- a/GameEngine/GameEngine.cpp	Mon Apr 17 18:22:16 2017 +0000
+++ b/GameEngine/GameEngine.cpp	Tue Apr 18 11:21:35 2017 +0000
@@ -25,18 +25,22 @@
 }
 void GameEngine::weapUpgrade(Gamepad &pad, N5110 &lcd) {
     if (pad.check_event(Gamepad::START_PRESSED)) { 
-        wu.upgrading = 1;
-        while (wu.upgrading == 1) {
-            wu.main_Upgrades(pad, lcd);
-            if (wu.saveTheData == 1) {
-                Data _upgrades = wu.savedata(); //saving data
-                wu.testingtest(_upgrades);  //code used to test the struct
-                printf("TESTING up = %d, up1 = %d, u1p = %d, u1p1 = %d \n",_upgrades.up,_upgrades.up1,_upgrades.u1p,_upgrades.u1p1); 
-                wu.saveTheData = 0;
-                wu.upgrading = 0; //get out of while loop after done upgrading
+        _gui.upgrading = 1;
+        _gui.preventDoubleClick(pad);
+        while (_gui.upgrading == 1) {
+            _gui.main_Upgrades(pad, lcd); //go to the main upgrade page
+            if (_gui.saveTheData == 1) {
+                Data _upgrades = _gui.savedata(); //saving data
+                //_gui.testingtest(_upgrades);  //code used to test the struct
+                weap.setVar(_upgrades.up, _upgrades.up1);
+                weap.setVar(_upgrades.u1p, _upgrades.u1p1);
+                //weap.testtest();
+                //printf("TESTING up = %d, up1 = %d, u1p = %d, u1p1 = %d \n",_upgrades.up,_upgrades.up1,_upgrades.u1p,_upgrades.u1p1); 
+                _gui.saveTheData = 0;
+                _gui.upgrading = 0; //get out of while loop after done upgrading
             }
             lcd.refresh();
-            wait(0.3);
+            wait(0.2);
             lcd.clear();
         } 
         done = 1;