pythonified

This commit is contained in:
Lukas Nöllemeyer 2024-08-17 13:25:56 +02:00
parent b04ebc5bef
commit 765bb47652

View file

@ -40,7 +40,7 @@ class MainScreen(Screen):
case tcod.event.KeyDown(sym=sym) if sym in DIRECTION_KEYS:
new_pos = player.components[Position] + DIRECTION_KEYS[sym]
map_pos = world_pos_to_map_pos(new_pos)
if not map.walkable[map_pos.y][map_pos.x]:
if not map.walkable[map_pos.y, map_pos.x]:
return None
player.components[Position] = new_pos
cam_map = world_pos_to_map_pos(new_pos)
@ -76,7 +76,7 @@ class MainScreen(Screen):
map_pos = world_pos_to_map_pos(e_pos)
if (-w <= screen_pos.x < w\
and -h <= screen_pos.y < h):
if map.fov[map_pos.y][map_pos.x]:
if map.fov[map_pos.y, map_pos.x]:
graphic = e_graph
else:
graphic = Graphic(0x2591, (50, 50, 50))