aboutsummaryrefslogtreecommitdiff
path: root/src/game_loop/gameplay.c
diff options
context:
space:
mode:
authorUnavailableDev <ggwildplay@gmail.com>2023-04-03 10:09:40 +0200
committerUnavailableDev <ggwildplay@gmail.com>2023-04-03 10:09:40 +0200
commit05504df10934cac60b774fb10e86593ec3897510 (patch)
tree89a418bb7477904f394e460d5e661c3047117030 /src/game_loop/gameplay.c
parent54c3e1139e3e0e328f7ce3e8a2a61b0bf530a772 (diff)
parent0a014f39c375c0cf28de70ebaab6cb0a5266f3c2 (diff)
Merge branch 'dev' of https://github.com/UnavailableDev/avans-arcade into dev
Diffstat (limited to 'src/game_loop/gameplay.c')
-rw-r--r--src/game_loop/gameplay.c47
1 files changed, 47 insertions, 0 deletions
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(){}