pythonified
This commit is contained in:
parent
b04ebc5bef
commit
765bb47652
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ class MainScreen(Screen):
|
||||||
case tcod.event.KeyDown(sym=sym) if sym in DIRECTION_KEYS:
|
case tcod.event.KeyDown(sym=sym) if sym in DIRECTION_KEYS:
|
||||||
new_pos = player.components[Position] + DIRECTION_KEYS[sym]
|
new_pos = player.components[Position] + DIRECTION_KEYS[sym]
|
||||||
map_pos = world_pos_to_map_pos(new_pos)
|
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
|
return None
|
||||||
player.components[Position] = new_pos
|
player.components[Position] = new_pos
|
||||||
cam_map = world_pos_to_map_pos(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)
|
map_pos = world_pos_to_map_pos(e_pos)
|
||||||
if (-w <= screen_pos.x < w\
|
if (-w <= screen_pos.x < w\
|
||||||
and -h <= screen_pos.y < h):
|
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
|
graphic = e_graph
|
||||||
else:
|
else:
|
||||||
graphic = Graphic(0x2591, (50, 50, 50))
|
graphic = Graphic(0x2591, (50, 50, 50))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue