diff options
author | NielsCoding <48092678+heavydemon21@users.noreply.github.com> | 2023-03-15 15:37:21 +0100 |
---|---|---|
committer | NielsCoding <48092678+heavydemon21@users.noreply.github.com> | 2023-03-15 15:37:21 +0100 |
commit | 3891486b368f4cdd1c5e00019a2a66ca05e656e6 (patch) | |
tree | cd27ef74ef917bed16c90be9552dd007b4a7f2b5 /src/GameLoop | |
parent | 67bbe8dc3e7e0eb5eeb00b84f9766ef3d3b6b4b4 (diff) |
game loop and bullet
TODO game loop:
-(startingscreen) read correct indexes
-(shop) read correct indexes
-gameplay still needs alot with different levels etc..
rest not yet done
bullet needs testing and correct PAL and tilemap reading
Diffstat (limited to 'src/GameLoop')
-rw-r--r-- | src/GameLoop/shop.c | 28 | ||||
-rw-r--r-- | src/GameLoop/shop.h | 15 | ||||
-rw-r--r-- | src/GameLoop/startingScreen.c | 30 | ||||
-rw-r--r-- | src/GameLoop/startingScreen.h | 14 |
4 files changed, 87 insertions, 0 deletions
diff --git a/src/GameLoop/shop.c b/src/GameLoop/shop.c new file mode 100644 index 0000000..31ff5ce --- /dev/null +++ b/src/GameLoop/shop.c @@ -0,0 +1,28 @@ +#include "shop.h" + + +bool hh_show_Shop(){ + static hh_e_ShopStates hh_e_Shop = hh_e_STATE_SHOW; + + switch (hh_e_Shop) + { + case hh_e_STATE_SHOW: + hh_setup_startingScreen(); + hh_e_Shop = hh_e_STATE_Input; + return false; + break; + case hh_e_STATE_Input: + if(g_hh_controller_p1.dpad_right){ + hh_e_Shop = hh_e_STATE_END; + } + break; + case hh_e_STATE_END: + hh_e_Shop = hh_e_STATE_SHOW; + return true; + break; + default: + hh_e_Shop = hh_e_STATE_SHOW; + break; + } + return false; +} diff --git a/src/GameLoop/shop.h b/src/GameLoop/shop.h new file mode 100644 index 0000000..35bb780 --- /dev/null +++ b/src/GameLoop/shop.h @@ -0,0 +1,15 @@ +#include "input.h" +#include "engine/draw_screen.h" + + +#include <stdint.h> +#include <stdbool.h> + +typedef enum { + hh_e_STATE_SHOW, + hh_e_STATE_Input, + hh_e_STATE_END +} hh_e_ShopStates; + + +bool hh_show_Shop(); diff --git a/src/GameLoop/startingScreen.c b/src/GameLoop/startingScreen.c new file mode 100644 index 0000000..a0cd283 --- /dev/null +++ b/src/GameLoop/startingScreen.c @@ -0,0 +1,30 @@ +#include "startingScreen.h" +#include "input.h" +#include "engine/draw_screen.h" +// #include "engine/player_controller.h" + +bool hh_show_startingScreen(){ + static hh_e_screenStates hh_e_startingScreen = hh_e_STATE_SHOW; + + switch (hh_e_startingScreen) + { + case hh_e_STATE_SHOW: + hh_setup_startingScreen(); + hh_e_startingScreen = hh_e_STATE_Input; + return false; + break; + case hh_e_STATE_Input: + if(g_hh_controller_p1.dpad_left){ + hh_e_startingScreen = hh_e_STATE_END; + } + break; + case hh_e_STATE_END: + hh_e_startingScreen = hh_e_STATE_SHOW; + return true; + break; + default: + hh_e_startingScreen = hh_e_STATE_SHOW; + break; + } + return false; +} diff --git a/src/GameLoop/startingScreen.h b/src/GameLoop/startingScreen.h new file mode 100644 index 0000000..f51cc66 --- /dev/null +++ b/src/GameLoop/startingScreen.h @@ -0,0 +1,14 @@ +#pragma once + +#include <stdint.h> +#include <stdbool.h> + +typedef enum { + hh_e_STATE_SHOW, + hh_e_STATE_Input, + hh_e_STATE_END +} hh_e_screenStates; + + +bool hh_show_startingScreen(); + |