diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-09 19:26:13 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-09 19:26:13 +0200 |
| commit | f0b654b9bf3bc2a93c1f89d4cc3edcf77b948555 (patch) | |
| tree | 91b7404dca0b6eb136cb7f9b144435419144b777 /Gameplay.cpp | |
| parent | d85464781580796bbcc744ae732e56d1920e3b0f (diff) | |
| download | pocketempires-f0b654b9bf3bc2a93c1f89d4cc3edcf77b948555.tar.gz | |
Game has been restructured in favor of OOP
Diffstat (limited to 'Gameplay.cpp')
| -rw-r--r-- | Gameplay.cpp | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/Gameplay.cpp b/Gameplay.cpp deleted file mode 100644 index 1613a86..0000000 --- a/Gameplay.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* ************************************** - * Includes * - * **************************************/ - -#include "Gameplay.h" -#include "MouseSpr.i" -#include "Pad.h" -#include "Camera.h" - -/* ************************************** - * Defines * - * **************************************/ - -/* ************************************** - * Global variables * - * **************************************/ - -Player GamePlayers[GAME_MAX_PLAYERS]; - -/* ************************************** - * Local variables * - * **************************************/ - -static const char PauseMenuOption_0[] PROGMEM = "Resume"; -static const char PauseMenuOption_1[] PROGMEM = "Quit"; -static TYPE_SPRITE MouseSpr; - -static const char* const PauseMenuOptions[] PROGMEM = { PauseMenuOption_0, - PauseMenuOption_1 }; - -/* ************************************** - * Local prototypes * - * **************************************/ - -static void GameCalculations(void); -static void GameGraphics(void); -static bool GamePause(void); -static void GameLoop(void); - -void GameInit(void) -{ - for (uint8_t i = 0; i < GAME_MAX_PLAYERS; i++) - { - GamePlayers[i].Init(); - } - - GamePlayers[0].setHuman(true); - - MouseSpr.Data = MouseSprData; - MouseSpr.color = GFX_INVERT; - MouseSpr.rotation = NOROT; - MouseSpr.flip = NOFLIP; - MouseSpr.x = (X_SCREEN_RESOLUTION >> 1) - 4; - MouseSpr.y = (Y_SCREEN_RESOLUTION >> 1) - 4; - - GfxInit(); - - GameLoop(); -} - -bool GamePause(void) -{ - if (PadButtonReleased(PAD_C) != false) - { - uint8_t choice = gb.menu(PauseMenuOptions, 2); - - if (choice != 0) - { - return true; - } - } - - return false; -} - -void GameCalculations(void) -{ - uint8_t i; - - for (i = 0; i < GAME_MAX_PLAYERS; i++) - { - GamePlayers[i].Handler(); - } - - if (PadAnyKeyPressed() != false) - { - SystemSetRandSeed(); - } -} - -void GameGraphics(void) -{ - uint8_t i; - - GfxClearScreen(); - - for (i = 0; i < GAME_MAX_PLAYERS; i++) - { - GamePlayers[i].DrawHandler(); - } - - GfxDrawSprite(&MouseSpr); -} - -void GameLoop(void) -{ - while (1) - { - if (GamePause() != false) - { - return; - } - - GameCalculations(); - - while (GfxRefreshNeeded() == false); - - GameGraphics(); - - SystemIncreaseGlobalTimer(); - } -} |
