asciigame/demo.py

44 lines
905 B
Python
Raw Normal View History

2022-04-28 20:53:34 -05:00
#!/usr/bin/env python3
2022-04-29 16:07:21 -05:00
import map
import render
import water
import utils
2022-04-28 20:53:34 -05:00
def main():
textures = []
2022-04-29 16:07:21 -05:00
textures.append(map.Texture("char", "#", "hash"))
textures.append(map.Texture("mchar", "simple", "simple"))
textures.append(map.Texture("char", "o", "water"))
2022-04-28 20:53:34 -05:00
for i in textures:
i.load()
tiles = []
for i in range(10, 20):
for j in range(2, 8):
2022-04-29 16:07:21 -05:00
t = map.Tile([i, j], "placeholder")
2022-04-28 20:53:34 -05:00
t.addTexture(textures[0])
tiles.append(t)
2022-04-29 16:07:21 -05:00
t = map.Tile([23, 2], "placeholder")
2022-04-28 20:53:34 -05:00
t.addTexture(textures[1])
tiles.append(t)
2022-04-29 16:07:21 -05:00
t = water.WaterTile([30, 2], source=True)
t.addTexture(textures[2])
tiles.append(t)
renderer = render.Renderer()
[renderer.addTile(i) for i in tiles]
while True:
renderer.massUpdate()
renderer.finalRender()
2022-04-28 20:53:34 -05:00
2022-04-29 16:07:21 -05:00
input()
2022-04-28 20:53:34 -05:00
if __name__ == "__main__":
main()