def update_shapes(self):
if self._old_poly_cache:
self._space.remove(*self._old_poly_cache)
+ for poly in self._old_poly_cache:
+ poly.body = None
new_polys = self._old_poly_cache = self.polys()
self._space.add(*new_polys)
angle = math.atan2(distance[1], distance[0])
# Set light angle to this position
self._dragging.ray_manager.direction = math.degrees(angle)
+ self._dragging.ray_manager.update_shapes()
# Hackily update gamestate with new angle
for light_cfg in gamestate.station["lights"]:
light_pos = pymunk.Vec2d(light_cfg["position"])