mirror of
https://github.com/Steffo99/flyingsnake.git
synced 2024-12-22 06:34:18 +00:00
Make section drawings accurate
This commit is contained in:
parent
62cea57c15
commit
4bb448bdbf
1 changed files with 16 additions and 6 deletions
|
@ -130,12 +130,22 @@ def flyingsnake(input_file: str,
|
||||||
c.echo("Drawing the background...")
|
c.echo("Drawing the background...")
|
||||||
background = Image.new("RGBA", (width, height))
|
background = Image.new("RGBA", (width, height))
|
||||||
draw = ImageDraw.Draw(background)
|
draw = ImageDraw.Draw(background)
|
||||||
draw.rectangle(((0, 0), (width, world.underground_level)), tuple(colors["Globals"]["Sky"]))
|
curr_y = 0
|
||||||
draw.rectangle(((0, world.underground_level + 1), (width, world.cavern_level)),
|
if min_y <= world.underground_level:
|
||||||
tuple(colors["Globals"]["Earth"]))
|
sky_y = min(world.underground_level - min_y, height)
|
||||||
draw.rectangle(((0, world.cavern_level + 1), (width, height - 192)),
|
draw.rectangle(((0, curr_y), (width, sky_y)), tuple(colors["Globals"]["Sky"]))
|
||||||
tuple(colors["Globals"]["Rock"]))
|
curr_y = sky_y + 1
|
||||||
draw.rectangle(((0, height - 191), (width, height)), tuple(colors["Globals"]["Hell"]))
|
if max_y > world.underground_level and min_y <= world.cavern_level:
|
||||||
|
earth_y = min(world.cavern_level - min_y, height)
|
||||||
|
draw.rectangle(((0, curr_y), (width, earth_y)), tuple(colors["Globals"]["Earth"]))
|
||||||
|
curr_y = earth_y + 1
|
||||||
|
edge_of_rock = world.size_y - 192
|
||||||
|
if max_y > world.cavern_level and min_y <= edge_of_rock:
|
||||||
|
rock_y = min(edge_of_rock - min_y, height)
|
||||||
|
draw.rectangle(((0, curr_y), (width, edge_of_rock + 1)), tuple(colors["Globals"]["Rock"]))
|
||||||
|
curr_y = rock_y + 1
|
||||||
|
if max_y > edge_of_rock:
|
||||||
|
draw.rectangle(((0, curr_y), (width, height)), tuple(colors["Globals"]["Hell"]))
|
||||||
del draw
|
del draw
|
||||||
to_merge.append(background)
|
to_merge.append(background)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue