38 lines
681 B
Python
Executable File
38 lines
681 B
Python
Executable File
#!./bin/python
|
|
import tcod
|
|
|
|
from engine import Engine
|
|
|
|
def main() -> None:
|
|
#assets
|
|
tileset = tcod.tileset.load_tilesheet("assets/dejavu10x10_gs_tc.png", 32, 8, tcod.tileset.CHARMAP_TCOD)
|
|
|
|
context = tcod.context.new(
|
|
columns = 40,
|
|
rows = 20,
|
|
tileset = tileset,
|
|
title = "Stepwise Roguelike",
|
|
vsync = True
|
|
)
|
|
|
|
w, h = context.recommended_console_size(min_columns=10, min_rows=10)
|
|
|
|
print(w, h)
|
|
|
|
console = tcod.console.Console(
|
|
width = w,
|
|
height = h,
|
|
order = "F"
|
|
)
|
|
|
|
engine = Engine()
|
|
|
|
# game loop
|
|
while True:
|
|
engine.render(context, console)
|
|
events = tcod.event.wait()
|
|
engine.handle_events(events)
|
|
|
|
# this seems odd to me
|
|
if __name__ == "__main__":
|
|
main() |