![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: main.cpp
- Revision:
- 7:48ba87cd79b5
- Parent:
- 6:3ffab44ed49c
- Child:
- 8:890b986b16a4
diff -r 3ffab44ed49c -r 48ba87cd79b5 main.cpp --- a/main.cpp Sat Mar 23 15:07:15 2019 +0000 +++ b/main.cpp Tue Mar 26 14:45:15 2019 +0000 @@ -14,7 +14,7 @@ #include "N5110.h" #include "FXOS8700CQ.h" #include "StartScreen.h" -//#include "SnakevsBlock.h" +#include "SnakevsBlock.h" /////////////// structs ///////////////// struct UserInput { @@ -27,12 +27,12 @@ Gamepad pad; FXOS8700CQ device(I2C_SDA,I2C_SCL); StartScreen _start; -//SnakevsBlock game; +SnakevsBlock game; -///////////// prototypes /////////////// +///////////// prototypes ////////////// void init(); +void update_game(UserInput input); void refresh_game(); -//void update_game(UserInput input); //Constants// int fps = 7; // frames per second @@ -53,8 +53,8 @@ // snakeVSblock - detect input respect to the menu options, and update data and refresh screen while (1) { - //game.read_input(pad); - //game.update(pad); + game.read_input(pad); + game.update(pad); refresh_game(); wait(1.0f/fps); @@ -68,14 +68,15 @@ lcd.init(); pad.init(); pad.tone(1000.0,0.1); - //game.init(); + game.init(); } void refresh_game() { lcd.clear(); - //game.draw(lcd, pad); + game.draw(lcd, pad); + game.get_pos(); lcd.refresh(); } \ No newline at end of file