![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: main.cpp
- Revision:
- 73:80556a279962
- Parent:
- 72:4d49d2544cef
- Child:
- 79:35cb65c52d25
diff -r 4d49d2544cef -r 80556a279962 main.cpp --- a/main.cpp Sat May 04 22:16:02 2019 +0000 +++ b/main.cpp Sun May 05 10:58:33 2019 +0000 @@ -8,46 +8,12 @@ Date: 07/03/2019 */ -///////// pre-processor directives //////// -#include "mbed.h" -#include "Gamepad.h" -#include "N5110.h" -#include "FXOS8700CQ.h" -#include "StartScreen.h" -#include "SnakevsBlock.h" -#include "SDFileSystem.h" - -#ifdef TEST_SNAKE -# include "tests.h" -#endif +#include "main.h" +/** @file main.cpp + * @brief This file is designated to start the program by calling all the necessary functions in a sequential manner. + */ -/////////////// objects /////////////// -N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); -Gamepad pad; -FXOS8700CQ device(I2C_SDA,I2C_SCL); -StartScreen _start; -Stats _stats; -SnakevsBlock _game; -AnalogIn noisy(PTB0); //This creates a random noise which I can use to seed the random numbers. -// Connections to SD card holder on K64F (SPI interface) -SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); // MOSI, MISO, SCK, CS -//Serial serial(USBTX, USBRX); // for PC debug - -///////////// prototypes ////////////// -void init(); -void refresh_game(); -void menu(); -void read_write_stats(); -void _set_mode_speed(); -void gameLoop(); -//void deinit(); - -//Constants// -int fps = 40; // frames per second, this will be changed in menu. -int g_mode = 1; //selects between joystick and motion control. -int back; //this allows us to use the back key to exit the game loop; - -///////////// MAIN //////////////// +///////////// MAIN.CPP //////////////// int main() { #ifdef TEST_SNAKE