From b30646103db7c86042d9bd2429848c469cec850d Mon Sep 17 00:00:00 2001 From: En Yi Date: Fri, 18 Aug 2023 23:26:47 +0800 Subject: [PATCH] Remove velocity check in moveable system It's funner that way --- scenes/game_systems.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scenes/game_systems.c b/scenes/game_systems.c index 1fbf0f0..43e9b56 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -199,8 +199,6 @@ static Vector2 shift_bbox(Vector2 bbox, Vector2 new_bbox, AnchorPoint_t anchor) void player_respawn_system(Scene_t* scene) { - LevelSceneData_t* data = &(CONTAINER_OF(scene, LevelScene_t, scene)->data); - TileGrid_t tilemap = data->tilemap; Entity_t* p_player; // Cannot create player while looping though the players // So have to create outside of the loop @@ -902,12 +900,12 @@ void moveable_update_system(Scene_t* scene) // Intentional. Want this check even after a gridmove to allow gridmove after that if (!p_moveable->gridmove) { - if (p_ctransform->prev_velocity.y <= 0 && p_ctransform->prev_position.x == p_ctransform->position.x) continue; + //if (p_ctransform->prev_velocity.y <= 0 && p_ctransform->prev_position.x == p_ctransform->position.x) continue; TileGrid_t tilemap = (CONTAINER_OF(scene, LevelScene_t, scene)->data).tilemap; Vector2 point_to_check = { .x = p_ctransform->position.x + p_bbox->half_size.x, - .y = p_ctransform->position.y + p_bbox->size.y + 5 // 5 is arbitrary, just to make sure there's a little gap + .y = p_ctransform->position.y + p_bbox->size.y + 1 }; int tile_x = point_to_check.x / TILE_SIZE; int tile_y = point_to_check.y / TILE_SIZE;