diff options
author | NielsCoding <48092678+heavydemon21@users.noreply.github.com> | 2023-03-30 13:02:36 +0200 |
---|---|---|
committer | NielsCoding <48092678+heavydemon21@users.noreply.github.com> | 2023-03-30 13:02:36 +0200 |
commit | 552dcc17db2b98287ba1b480c2e70759cd94d81f (patch) | |
tree | 7f7bbd7a8b3964bbebc2878d33be0ed8a9382e3f /src/demo.c | |
parent | 7f51cd925883bbf958baa289d4d19231667c9eba (diff) |
gameloop/bullet/levels
gameloop moet nog wat gefixt worden. shop moet nog wat art en functie krijgen zefde voor gameover/highscore
bullet moet meerdere entityten kunnen doen nu nog alleen gemaakt voor 1.
levels moet alleen nog backwords kunnen
Diffstat (limited to 'src/demo.c')
-rw-r--r-- | src/demo.c | 35 |
1 files changed, 9 insertions, 26 deletions
@@ -11,19 +11,14 @@ #include "engine/draw_screen.h" #include "engine/player_controller.h" #include "engine/sprite_controller.h" -#include "GameLoop/startingScreen.h" - +#include "engine/level_const.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; +#include "GameLoop/startingScreen.h" +#include "GameLoop/gameplay.h" +#include "GameLoop/shop.h" +hh_g_all_levels hh_game; uint16_t g_hh_pos_x = 1000; // 0b0000 0001 0011 0110 uint16_t g_hh_pos_y; @@ -43,13 +38,13 @@ typedef struct { }hh_s_tiles; +hh_e_GameState hh_gameStates; hh_entity hh_g_player, hh_g_player_new; void hh_demo_setup() { hh_setup_palettes(); // hh_setup_screen(); - - + hh_game = hh_init_game_levels(); } void hh_demo_loop(unsigned long frame) { @@ -64,22 +59,10 @@ void hh_demo_loop(unsigned long frame) { } 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 + hh_Shop(&hh_gameStates); break; case hh_e_STATE_Gameplay: - hh_player_actions(); - - // TODO: - // function: if level complete goto shop - // function: if player is dead goto game over + hh_gameplay(hh_game, &hh_gameStates); break; case hh_e_STATE_GameOver: // TODO: |