asciigame/demo.py

33 lines
660 B
Python
Raw Normal View History

2022-04-28 20:53:34 -05:00
#!/usr/bin/env python3
2022-04-29 11:33:31 -05:00
import map
import render
2022-04-28 20:53:34 -05:00
def main():
textures = []
2022-04-29 11:33:31 -05:00
textures.append(map.Texture("char", "#", "hash"))
textures.append(map.Texture("mchar", "simple", "simple"))
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 11:33:31 -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 11:33:31 -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 11:33:31 -05:00
renderer = render.Renderer()
[renderer.addTile(i) for i in tiles]
2022-04-28 20:53:34 -05:00
2022-04-29 11:33:31 -05:00
renderer.finalRender()
2022-04-28 20:53:34 -05:00
if __name__ == "__main__":
main()