Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: main.cpp
- Revision:
- 63:205f0ca48473
- Parent:
- 62:ebf6ecf8a6d5
- Child:
- 66:e47333ffc6ca
diff -r ebf6ecf8a6d5 -r 205f0ca48473 main.cpp --- a/main.cpp Tue Apr 30 14:53:38 2019 +0000 +++ b/main.cpp Wed May 01 22:35:40 2019 +0000 @@ -58,7 +58,12 @@ while (1) { game.read_input(pad, device, g_mode); //this reads the angle or joystick direction, on the condition of either of them being selected. - back = game.update(lcd, pad, sd); //the int back stores the value 1 if back is pressed inside the update function of snakevsblock + game.update(lcd, pad); //updates the game screen and checks for any collisions. + back = game.CheckGameProgression(lcd, pad, sd); //the int back stores the value 1 if back is pressed inside the update function of snakevsblock, + //This function also handles level progression and level failure operations by using the class WinLoose. + //and also sends relevant data to the sd card to implement stats functionality. + + if(back) { break; //and this allows us to return to main menu by using the keyword break. }