JianWei Lee
/
project_game
Meteor defense project
Diff: main.cpp
- Revision:
- 30:2e2d48cbfec3
- Parent:
- 29:6632dd9c48d8
- Child:
- 31:1c0e47931e84
--- a/main.cpp Tue Apr 18 11:21:35 2017 +0000 +++ b/main.cpp Tue Apr 18 21:50:14 2017 +0000 @@ -35,12 +35,12 @@ init(); while (true) { if (setTicker == 1) { + game.init(waveNumber); sprintf(wave, "wave %d", waveNumber + 1); //+1 because initially waveNumber = 0 lcd.printString(wave,10,3); render(); wait(2.0); - game.init(); - waveCompleteTicker.attach(&waveComplete_isr,60); + waveCompleteTicker.attach(&waveComplete_isr,200); setTicker = 0; //clear set ticker flag } @@ -56,7 +56,7 @@ waveComplete_flag = 0; //get out of while loop setTicker = 1; //continue the game game.done = 0; - printf("i got out"); + //printf("i got out"); } } render(); @@ -67,7 +67,7 @@ // need to initialise LCD and Gamepad lcd.init(); pad.init(); - game.init(); + game.init(waveNumber); // initialise the game } void render() {