recalculate FOV only on movement or door opening
This commit is contained in:
parent
1bd0ab372d
commit
bbc958b36c
2 changed files with 14 additions and 6 deletions
|
|
@ -46,10 +46,10 @@ def new_world() -> Registry:
|
|||
map.transparent[:] = True
|
||||
|
||||
rng = world[None].components[Random] = Random()
|
||||
|
||||
player_pos = Position(5,5)
|
||||
world.new_entity(
|
||||
components={
|
||||
Position: Position(5,5),
|
||||
Position: player_pos,
|
||||
Graphic: Graphic(ord('@')),
|
||||
Gold: 0
|
||||
},
|
||||
|
|
@ -77,6 +77,8 @@ def new_world() -> Registry:
|
|||
else:
|
||||
add_wall(world, Position(10, i))
|
||||
|
||||
cam_pos = world_pos_to_map_pos(player_pos)
|
||||
map.compute_fov(cam_pos.x, cam_pos.y)
|
||||
return world
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue