Compare commits

..

No commits in common. "8ae999ccc8869df424dd8d7c7afef18f1def6988" and "be75263c2c38f3557ca7f521d108629298ae1164" have entirely different histories.

3 changed files with 16 additions and 39 deletions

View File

@ -52,7 +52,7 @@ static bool parse_emitter_info(char* emitter_info_str, EmitterConfig_t* conf)
if (data_count == 8)
{
conf->type = (emitter_type == 'b') ? EMITTER_BURST : EMITTER_UNKNOWN;
conf->one_shot = (one_shot == '1');
conf->one_shot = (one_shot == 1);
}
return data_count == 8;
}

View File

@ -274,6 +274,17 @@ static void render_editor_game_scene(Scene_t* scene)
}
}
// Draw water tile
uint32_t water_height = tilemap.tiles[i].water_level * WATER_BBOX_STEP;
// Draw water tile
Color water_colour = ColorAlpha(BLUE, 0.5);
DrawRectangle(
x,
y + (TILE_SIZE - water_height),
TILE_SIZE,
water_height,
water_colour
);
if (tilemap.tiles[i].max_water_level < MAX_WATER_LEVEL)
{
DrawRectangleLinesEx((Rectangle){x, y, TILE_SIZE, TILE_SIZE}, 2.0, ColorAlpha(BLUE, 0.5));
@ -427,27 +438,6 @@ static void render_editor_game_scene(Scene_t* scene)
DrawCircleV(p_ct->position, tilemap.tile_size >> 1, (data->coins.current < data->coins.total)? RED : GREEN);
}
for (int tile_y = min.y; tile_y < max.y; tile_y++)
{
for (int tile_x = min.x; tile_x < max.x; tile_x++)
{
int i = tile_x + tile_y * tilemap.width;
int x = tile_x * TILE_SIZE;
int y = tile_y * TILE_SIZE;
uint32_t water_height = tilemap.tiles[i].water_level * WATER_BBOX_STEP;
// Draw water tile
Color water_colour = ColorAlpha(BLUE, 0.5);
DrawRectangle(
x,
y + (TILE_SIZE - water_height),
TILE_SIZE,
water_height,
water_colour
);
}
}
sc_map_foreach_value(&scene->ent_manager.entities_map[DYNMEM_ENT_TAG], p_ent)
{
CWaterRunner_t* p_runner = get_component(p_ent, CWATERRUNNER_T);

View File

@ -1623,7 +1623,9 @@ void hitbox_update_system(Scene_t* scene)
CBBox_t* p_bbox = get_component(p_ent, CBBOX_COMP_T);
CPlayerState_t* p_pstate = get_component(p_ent, CPLAYERSTATE_T);
if (p_pstate != NULL)
if (
p_pstate != NULL
)
{
if (p_ctransform->position.y + p_bbox->size.y <= p_other_ct->position.y)
{
@ -1658,22 +1660,7 @@ void hitbox_update_system(Scene_t* scene)
{
remove_component(p_other_ent, CHURTBOX_T);
CLifeTimer_t* p_clifetimer = add_component(p_other_ent, CLIFETIMER_T);
if (p_other_ent->m_tag == CRATES_ENT_TAG)
{
CContainer_t* p_container = get_component(p_other_ent, CCONTAINER_T);
if (p_container->item == CONTAINER_BOMB)
{
p_clifetimer->life_time = 6;
}
else
{
p_clifetimer->life_time = 3;
}
}
else
{
p_clifetimer->life_time = 3;
}
p_clifetimer->life_time = 3;
}
}
else