From e987d23d915942ec4a3910b9cc2729f1b21361a9 Mon Sep 17 00:00:00 2001 From: NielsCoding <48092678+heavydemon21@users.noreply.github.com> Date: Sun, 2 Apr 2023 20:48:06 +0200 Subject: snake case/background --- src/game_loop/gameplay.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/game_loop/gameplay.c (limited to 'src/game_loop/gameplay.c') diff --git a/src/game_loop/gameplay.c b/src/game_loop/gameplay.c new file mode 100644 index 0000000..295eb5d --- /dev/null +++ b/src/game_loop/gameplay.c @@ -0,0 +1,47 @@ +#include "gameplay.h" + +// player struct + + +void hh_gameplay(hh_g_all_levels game, hh_e_game_state* hh_game_state){ + static hh_e_gameplay gameplay = hh_e_setup_screen; + + switch (gameplay) + { + case hh_e_setup_screen: + hh_setup_screen(game.level[game.current_level]); + gameplay = hh_e_play_level; + break; + case hh_e_play_level: + // todo: here come all the different functions for the gameplay + hh_player_actions(); + + + + + + if(game.level[game.current_level].hh_level_completed){ + gameplay = hh_e_level_complete; + } + break; + case hh_e_level_complete: + if(game.current_level < 3){ + game.current_level++; + gameplay = hh_e_setup_screen; + } + else { + gameplay = hh_e_game_over; + } + break; + case hh_e_game_over: + // todo make reset levels + hh_reset_levels(); + gameplay = hh_e_setup_screen; + *hh_game_state = hh_e_state_game_over; + break; + default: + break; + } + +} +void hh_reset_levels(){} -- cgit v1.2.3