![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: main.h
- Revision:
- 73:80556a279962
- Child:
- 84:9950d561fdf8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.h Sun May 05 10:58:33 2019 +0000 @@ -0,0 +1,47 @@ +/** @file main.h + * @brief Main.cpp's header file that defines all the directives and objects to use along with the definition of it's own function prototypes. + */ + +///////////// MAIN.CPP //////////////// + +///////// 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 + + +/////////////// 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 + + +//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; + + +///////////// prototypes ////////////// +void init(); +void refresh_game(); +void menu(); +void read_write_stats(); +void _set_mode_speed(); +void gameLoop(); +//void deinit(); \ No newline at end of file