Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: main.cpp
- Revision:
- 79:35cb65c52d25
- Parent:
- 73:80556a279962
- Child:
- 83:329da564799a
--- a/main.cpp Sun May 05 17:22:48 2019 +0000 +++ b/main.cpp Sun May 05 23:48:57 2019 +0000 @@ -26,7 +26,7 @@ _start.titleScreen(lcd, pad); while(1) { //This loop is created for Play/Continue configuration menu(); //pops up the menu by calling the StartScreen Classes. - + // start the game _start.credits(lcd); // this is after the menu to allow us to hide credits if we want to play the game without wasting any time. wait(1.0f/fps); @@ -62,7 +62,6 @@ { lcd.clear(); //clears the N5110 screen for the next frame _game.draw(lcd, pad); //draws the next game frame - _game.get_pos(); //takes the game object coordinates and saves it privately to use later for implementing collisions. lcd.refresh(); //refreshes the N5110 screen to display the frame. } @@ -90,6 +89,7 @@ while (1) { refresh_game(); _game.read_input(pad, device, g_mode); //this reads the angle or joystick direction, on the condition of either of them being selected. + _game.get_pos(); //takes the game object coordinates and saves it privately to use later for implementing collisions. _game.update(lcd, pad); //updates the game screen and checks for any collisions. //the int back stores the value 1 if back is pressed inside the update function of snakevsblock,