diff options
author | UnavailableDev <ggwildplay@gmail.com> | 2023-03-24 20:20:44 +0100 |
---|---|---|
committer | UnavailableDev <ggwildplay@gmail.com> | 2023-03-24 20:20:44 +0100 |
commit | ba830f93a15299fd578b00969eff3c403456950c (patch) | |
tree | dced71397e2f51f82b9c2c6e9c677a135f048091 /src/engine/entity.c | |
parent | 810d05156a99dd0a1c6ae14d67685f63460ef621 (diff) |
added first pass on animation systems
Diffstat (limited to 'src/engine/entity.c')
-rw-r--r-- | src/engine/entity.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/engine/entity.c b/src/engine/entity.c index 535759d..b374f8c 100644 --- a/src/engine/entity.c +++ b/src/engine/entity.c @@ -45,7 +45,7 @@ void hh_solve_collision(vec2 pos_environment, hh_entity* entity){ } hh_entity hh_background_collision (hh_entity temp_old_entity,hh_entity temp_new_entity){ - temp_old_entity.is_grounded = false; + temp_new_entity.is_grounded = false; // solves x collision if (temp_old_entity.vel.x <= 0) { @@ -74,11 +74,13 @@ hh_entity hh_background_collision (hh_entity temp_old_entity,hh_entity temp_new_ hh_colidable(hh_world_to_tile((vec2){.x=temp_new_entity.pos.x + 15, .y=temp_new_entity.pos.y + 15}))) { temp_new_entity.pos.y = temp_new_entity.pos.y & ~15, temp_new_entity.vel.y = 0; - temp_old_entity.is_grounded = true; + temp_new_entity.is_grounded = true; } } - temp_old_entity.pos = temp_new_entity.pos; - temp_old_entity.vel = temp_new_entity.vel; + temp_old_entity = temp_new_entity; + // temp_old_entity.is_grounded = temp_new_entity.is_grounded; + // temp_old_entity.pos = temp_new_entity.pos; + // temp_old_entity.vel = temp_new_entity.vel; return temp_old_entity; } |