diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2023-03-20 19:11:41 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2023-03-20 19:11:41 +0100 |
commit | 72295b9df9c0de9e585cce3f41437965eb0390cb (patch) | |
tree | c4ec60c1773b654edd2177b5082d5d7d584b2ea4 /src/demo.c | |
parent | e79c36460f400991caa82598499c0ea7c37ebb90 (diff) |
demo version
Diffstat (limited to 'src/demo.c')
-rw-r--r-- | src/demo.c | 54 |
1 files changed, 51 insertions, 3 deletions
@@ -11,8 +11,18 @@ #include "engine/draw_screen.h" #include "engine/player_controller.h" #include "engine/sprite_controller.h" +#include "GameLoop/startingScreen.h" +typedef enum { + hh_e_STATE_startingScreen, + hh_e_STATE_Shop, + hh_e_STATE_Gameplay, + hh_e_STATE_GameOver, + hh_e_STATE_HighScore +} hh_e_GameState; +hh_e_GameState hh_gameStates; + uint16_t g_hh_pos_x = 1000; // 0b0000 0001 0011 0110 @@ -37,7 +47,7 @@ hh_entity hh_g_player, hh_g_player_new; void hh_demo_setup() { hh_setup_palettes(); - hh_setup_screen(); + // hh_setup_screen(); } @@ -45,8 +55,46 @@ void hh_demo_setup() { void hh_demo_loop(unsigned long frame) { - hh_player_actions(); - + switch (hh_gameStates) + { + case hh_e_STATE_startingScreen: + bool ret = hh_show_startingScreen(); + if(ret){ + hh_gameStates = hh_e_STATE_Shop; + } + break; + case hh_e_STATE_Shop: + // TODO: + // if(hh_show_Shop()){ + hh_clear_screen(); + hh_clear_sprite(); + hh_setup_screen(); + hh_clear_sprite(); + hh_gameStates = hh_e_STATE_Gameplay; + // } + // function: new level is chosen goto level + break; + case hh_e_STATE_Gameplay: + hh_player_actions(); + + // TODO: + // function: if level complete goto shop + // function: if player is dead goto game over + break; + case hh_e_STATE_GameOver: + // TODO: + // function: show game over screen + // function: after time goto high score + break; + case hh_e_STATE_HighScore: + // TODO: + // fucntion: show all previously scored points + // function: button pressed goto starting screen + break; + default: + hh_gameStates = hh_e_STATE_startingScreen; + break; + } } // void sendData(uint8_t address, uint16_t data) { |