recalculate FOV only on movement or door opening

This commit is contained in:
Lukas Nöllemeyer 2024-08-17 12:41:41 +02:00
parent 1bd0ab372d
commit bbc958b36c
2 changed files with 14 additions and 6 deletions

View file

@ -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