diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2023-04-03 18:03:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 18:03:36 +0200 |
commit | f47d082d2fb2d5e5b5a4d3e685d8d093699938d7 (patch) | |
tree | c1ccb7a2dcda405df3ab850f66927e9b3d12c7c3 /src/game_loop | |
parent | 68862666219c07ee62c9e59dd6866c1c7b26cc00 (diff) | |
parent | 9166352dfabdb0732d222be5d4ed10953f12a872 (diff) |
Merge pull request #50 from heavydemon21/dev
player controller update
Diffstat (limited to 'src/game_loop')
-rw-r--r-- | src/game_loop/gameplay.c | 49 | ||||
-rw-r--r-- | src/game_loop/starting_screen.c | 4 |
2 files changed, 48 insertions, 5 deletions
diff --git a/src/game_loop/gameplay.c b/src/game_loop/gameplay.c index 295eb5d..bc6c98d 100644 --- a/src/game_loop/gameplay.c +++ b/src/game_loop/gameplay.c @@ -5,6 +5,47 @@ void hh_gameplay(hh_g_all_levels game, hh_e_game_state* hh_game_state){ static hh_e_gameplay gameplay = hh_e_setup_screen; + static hh_entity player1={ + .hp = 4, + .speed = 6, + .is_grounded = false, + .is_hit = false, + .radius = 8, + .pos = (vec2){32,32}, + .size = (vec2){32,32}, + .vel = (vec2){0,0}, + .render = { + .frame0 = 80, + .palette = 3, + .fam = (hh_s_ppu_loc_fam_entry){ + .horizontal_flip = false, + .vertical_flip = false, + .palette_index = 3, + .tilemap_index = 80, + } + } + }; + // enemy gets replaced here is just for reference + static hh_entity enemy={ + .hp = 4, + .speed = 6, + .is_grounded = false, + .is_hit = false, + .radius = 8, + .pos = (vec2){128,48}, + .vel = (vec2){0,0}, + // .vec = (vec2){0,0}, + .render = { + .frame0 = 20, + .palette = 7, + .fam = (hh_s_ppu_loc_fam_entry){ + .horizontal_flip = false, + .vertical_flip = false, + .palette_index = 7, + .tilemap_index = 1, + } + } + }; switch (gameplay) { @@ -13,10 +54,12 @@ void hh_gameplay(hh_g_all_levels game, hh_e_game_state* hh_game_state){ gameplay = hh_e_play_level; break; case hh_e_play_level: - // todo: here come all the different functions for the gameplay - hh_player_actions(); - + // TODO: here come all the different functions for the gameplay + vec_cor cam_pos;//value in tiles + cam_pos = hh_draw_screen(player1.pos); + hh_player_actions(&player1,cam_pos); + // enemy's diff --git a/src/game_loop/starting_screen.c b/src/game_loop/starting_screen.c index 6ab0278..c11e4fc 100644 --- a/src/game_loop/starting_screen.c +++ b/src/game_loop/starting_screen.c @@ -1,8 +1,8 @@ -#include "starting_screen.h"" +#include "starting_screen.h" #include "input.h" #include "engine/title_screen.h" #include "engine/draw_screen.h" -// #include "engine/player_controller.h" +#include "engine/player_controller.h" bool hh_show_starting_screen(){ static hh_e_screen_states hh_e_starting_screen = hh_e_state_show; |