import pymunk.pygame_util
import pygame.draw
+from .constants import OBSTACLE_CATEGORY
+
+OBSTACLE_FILTER = pymunk.ShapeFilter(categories=OBSTACLE_CATEGORY)
+
class BaseObstacle(object):
def __init__(self):
def add(self, space):
if self.body.space is not None:
space.remove(self.body, *self.body.shapes)
+ for shape in self.shapes:
+ shape.filter = OBSTACLE_FILTER
space.add(self.body, *self.shapes)
def render(self, surface):