diff --git a/scenes/game_systems.c b/scenes/game_systems.c index 13a3664..4b9bdc6 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -28,7 +28,7 @@ static inline unsigned int get_tile_idx(int x, int y, TileGrid_t gridmap) { unsigned int tile_x = x / gridmap.tile_size; unsigned int tile_y = y / gridmap.tile_size; - return tile_y * gridmap.tile_size + tile_x; + return tile_y * gridmap.width + tile_x; } static inline void destroy_tile(LevelSceneData_t* lvl_data, unsigned int tile_idx) @@ -1895,8 +1895,7 @@ void airtimer_update_system(Scene_t* scene) Entity_t* p_ent = get_entity(&scene->ent_manager, ent_idx); if (!p_ent->m_alive) continue; CBBox_t* p_bbox = get_component(p_ent, CBBOX_COMP_T); - CMovementState_t* p_movement = get_component(p_ent, CMOVEMENTSTATE_T); - if (p_bbox == NULL || p_movement == NULL) continue; + if (p_bbox == NULL) continue; Vector2 point_to_check = { p_ent->position.x + p_bbox->half_size.x, diff --git a/scenes/player_ent.c b/scenes/player_ent.c index d6c44b8..bfb9028 100644 --- a/scenes/player_ent.c +++ b/scenes/player_ent.c @@ -98,8 +98,8 @@ Entity_t* create_player(EntityManager_t* ent_manager) CAirTimer_t* p_air = add_component(p_ent, CAIRTIMER_T); p_air->max_count = 10; p_air->curr_count = 10; - p_air->max_ftimer = 300; - p_air->decay_rate = 5; + p_air->max_ftimer = 1.0f; + p_air->decay_rate = 1.0f; CSprite_t* p_cspr = add_component(p_ent, CSPRITE_T); p_cspr->sprites = player_sprite_map;