40 lines
866 B
Python
Executable File
40 lines
866 B
Python
Executable File
#!venv/bin/python
|
|
import tcod
|
|
|
|
from engine import Engine
|
|
from procgen import generate_floor_map
|
|
from message_log import Message
|
|
import colors
|
|
|
|
def main() -> None:
|
|
#tcod stuff
|
|
context = tcod.context.new(
|
|
columns = 80,
|
|
rows = 45,
|
|
tileset = tcod.tileset.load_tilesheet("assets/dejavu10x10_gs_tc.png", 32, 8, tcod.tileset.CHARMAP_TCOD),
|
|
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 + 5,
|
|
order = "F"
|
|
)
|
|
|
|
engine = Engine(
|
|
#is created externally, because
|
|
floor_map = generate_floor_map(80, 45, 10, 10),
|
|
intro_msg = Message("Welcome to the Cave of Gobbos!", colors.welcome_text)
|
|
)
|
|
|
|
#game loop that never returns
|
|
engine.run_loop(context, console)
|
|
|
|
# this seems odd to me
|
|
if __name__ == "__main__":
|
|
main() |