Add air pockets to level data

main
En Yi 2024-11-11 22:59:32 +08:00
parent 9d5b54435b
commit c02eba9548
2 changed files with 9 additions and 13 deletions

View File

@ -181,16 +181,6 @@ Entity_t* create_bomb(EntityManager_t* ent_manager, Vector2 launch_dir)
Entity_t* p_bomb = add_entity(ent_manager, DESTRUCTABLE_ENT_TAG);
if (p_bomb == NULL) return NULL;
//p_bomb->position.x += (TILE_SIZE - 25) / 2;
//p_bomb->position.y += (TILE_SIZE - 25) / 2;
//if (launch_dir.x > 0)
//{
// p_bomb->position.x += TILE_SIZE/ 2;
//}
//else if (launch_dir.x < 0)
//{
// p_bomb->position.x -= TILE_SIZE / 2;
//}
add_component(p_bomb, CTILECOORD_COMP_T);
add_component(p_bomb, CMOVEMENTSTATE_T);

View File

@ -134,10 +134,16 @@ bool load_level_tilemap(LevelScene_t* scene, unsigned int level_num)
change_a_tile(&scene->data.tilemap, i, SOLID_TILE);
}
if (lvl_map.tiles[i].water > MAX_WATER_LEVEL) {
scene->data.tilemap.tiles[i].max_water_level = 0;
}
else
{
scene->data.tilemap.tiles[i].max_water_level = 4;
scene->data.tilemap.tiles[i].water_level = lvl_map.tiles[i].water;
scene->data.tilemap.tiles[i].wet = scene->data.tilemap.tiles[i].water_level > 0;
}
}
// Two pass
for (size_t i = 0; i < scene->data.tilemap.n_tiles;i++)
{