Update water flow rendering logic
parent
2e368704ce
commit
0c52718695
|
@ -115,15 +115,14 @@ static void level_scene_render_func(Scene_t* scene)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
bot <= tilemap.n_tiles
|
bot <= tilemap.n_tiles
|
||||||
&& tilemap.tiles[bot].water_level < MAX_WATER_LEVEL
|
|
||||||
&& tilemap.tiles[i].water_level == 0
|
&& tilemap.tiles[i].water_level == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (i % tilemap.width != 0 && tilemap.tiles[left].wet)
|
if (i % tilemap.width != 0 && tilemap.tiles[left].wet && (tilemap.tiles[bot].solid == SOLID || tilemap.tiles[bot-1].solid == SOLID))
|
||||||
{
|
{
|
||||||
DrawLineEx((Vector2){x, bot_line}, (Vector2){x + TILE_SIZE / 2, bot_line}, SURFACE_THICKNESS, ColorAlpha(BLUE, 0.7));
|
DrawLineEx((Vector2){x, bot_line}, (Vector2){x + TILE_SIZE / 2, bot_line}, SURFACE_THICKNESS, ColorAlpha(BLUE, 0.7));
|
||||||
}
|
}
|
||||||
if (right % tilemap.width != 0 && tilemap.tiles[right].wet)
|
if (right % tilemap.width != 0 && tilemap.tiles[right].wet && (tilemap.tiles[bot].solid == SOLID || tilemap.tiles[bot+1].solid == SOLID))
|
||||||
{
|
{
|
||||||
DrawLineEx((Vector2){x + TILE_SIZE / 2, bot_line}, (Vector2){x + TILE_SIZE, bot_line}, SURFACE_THICKNESS, ColorAlpha(BLUE, 0.7));
|
DrawLineEx((Vector2){x + TILE_SIZE / 2, bot_line}, (Vector2){x + TILE_SIZE, bot_line}, SURFACE_THICKNESS, ColorAlpha(BLUE, 0.7));
|
||||||
}
|
}
|
||||||
|
@ -563,6 +562,7 @@ static void toggle_block_system(Scene_t* scene)
|
||||||
if (tilemap.tiles[tile_idx].water_level < MAX_WATER_LEVEL)
|
if (tilemap.tiles[tile_idx].water_level < MAX_WATER_LEVEL)
|
||||||
{
|
{
|
||||||
tilemap.tiles[tile_idx].water_level = MAX_WATER_LEVEL;
|
tilemap.tiles[tile_idx].water_level = MAX_WATER_LEVEL;
|
||||||
|
tilemap.tiles[tile_idx].wet = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TOGGLE_AIR_POCKET:
|
case TOGGLE_AIR_POCKET:
|
||||||
|
|
|
@ -295,6 +295,10 @@ void update_water_runner_system(Scene_t* scene)
|
||||||
{
|
{
|
||||||
p_crunner->counter++;
|
p_crunner->counter++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curr_tile->wet = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue