asciigame/demo.py

44 lines
905 B
Python

#!/usr/bin/env python3
import map
import render
import water
import utils
def main():
textures = []
textures.append(map.Texture("char", "#", "hash"))
textures.append(map.Texture("mchar", "simple", "simple"))
textures.append(map.Texture("char", "o", "water"))
for i in textures:
i.load()
tiles = []
for i in range(10, 20):
for j in range(2, 8):
t = map.Tile([i, j], "placeholder")
t.addTexture(textures[0])
tiles.append(t)
t = map.Tile([23, 2], "placeholder")
t.addTexture(textures[1])
tiles.append(t)
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()
input()
if __name__ == "__main__":
main()