Skip to content
Snippets Groups Projects

Resolve "FOV of the players, fog-of-war like vision"

Merged Florian Schröder requested to merge 44-fov-of-the-players-fog-of-war-like-vision into main
Files
4
@@ -150,9 +150,9 @@ class Visualizer:
# rotate direction vector in both direction with the angel
# draw 2 large rect which are rotated so that one edge is the viewing border
direction = pygame.math.Vector2(state["view_restriction"][0])
pos = pygame.math.Vector2(state["view_restriction"][1])
angle = state["view_restriction"][2]
direction = pygame.math.Vector2(state["view_restriction"]["direction"])
pos = pygame.math.Vector2(state["view_restriction"]["position"])
angle = state["view_restriction"]["angle"]
pos = pos * grid_size + pygame.math.Vector2([grid_size / 2, grid_size / 2])
Loading