JianWei Lee
/
project_game
Meteor defense project
Diff: GameEngine/GameEngine.cpp
- Revision:
- 37:45da88e36d1d
- Parent:
- 36:2608622e5018
- Child:
- 38:c66a69c1a6de
--- a/GameEngine/GameEngine.cpp Sun Apr 23 22:52:48 2017 +0000 +++ b/GameEngine/GameEngine.cpp Mon Apr 24 11:11:39 2017 +0000 @@ -43,15 +43,16 @@ _gui.upgrading = 1; _gui.preventDoubleClick(pad); while (_gui.upgrading == 1) { - Variables copyVar = weap.getVar(); //this shit is not working. - //printf("copyvar %d \n",copyVar.laserDamage); - _gui.upgrades(copyVar, pad, lcd); //go to the main upgrade page + //printf("laserDamage = %i \n",weap._laserDamage); + //go to the main upgrade page with all the values (from Weapon) as reference. + _gui.upgrades(weap._laserDamage, weap._bombDamage, weap._bombR, weap._bombCooldown, _d1._droneDamage, _d1._droneRange, weap._shieldCapacity, weap._shieldRegenRate, pad, lcd); + //printf("_gui.saveTheData = %d",_gui.saveTheData); 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(); + 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 @@ -60,7 +61,7 @@ wait(0.2); lcd.clear(); } - doneUpgrade = 1; + doneUpgrade_flag = 1; //remember to re-initialise everything after a wave. } }