This repository was archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
63 lines (43 loc) · 1.33 KB
/
main.py
File metadata and controls
63 lines (43 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import tcod
from engine import Engine
from game_map import GameMap
from player import Player
from item import Item
from screen_handlers import MainGameScreenHandler
from message_log import MessageLog
def main() -> None:
screen_width = 80
screen_height = 50
map_width = 60
map_height = 40
fov_algorithm = 0
fov_light_walls = True
fov_radius = 10
tileset = tcod.tileset.load_tilesheet(
"font.png", 32, 8, tcod.tileset.CHARMAP_TCOD
)
with tcod.context.new_terminal(
screen_width,
screen_height,
tileset=tileset,
title="Yet Another Roguelike Tutorial",
vsync=True,
) as context:
root_console = tcod.console.Console(screen_width, screen_height, order="F")
player = Player(5,5, 20)
game_map = GameMap(map_width, map_height)
screen_handler = MainGameScreenHandler()
message_log = MessageLog(10)
engine = Engine(
screen_handler = screen_handler,
game_map = game_map,
player = player,
message_log = message_log,
context = context,
map_width = map_width,
map_height = map_height
)
engine.render(root_console)
engine.main_loop(root_console)
if __name__ == "__main__":
main()