def __init__(self, arena, number, damping): self._body = arena._physics_world.create_body( position=(0, 0), angle=0, linear_damping=damping, angular_damping=damping, type=pypybox2d.body.Body.DYNAMIC) GameObject.__init__(self, arena) self.marker_info = create_marker_info_by_type(MARKER_TOKEN, number) self.grabbed = False WIDTH = 0.08 self._body.create_polygon_fixture([(-WIDTH, -WIDTH), (WIDTH, -WIDTH), (WIDTH, WIDTH), (-WIDTH, WIDTH)], density=1, restitution=0.2, friction=0.3)
def __init__(self, arena, number, damping, token_type=MARKER_TOKEN): self._body = arena._physics_world.create_body(position=(0, 0), angle=0, linear_damping=damping, angular_damping=damping, type=pypybox2d.body.Body.DYNAMIC) GameObject.__init__(self, arena) self.marker_info = create_marker_info_by_type(token_type, number) self.grabbed = False WIDTH=0.08 self._body.create_polygon_fixture([(-WIDTH, -WIDTH), ( WIDTH, -WIDTH), ( WIDTH, WIDTH), (-WIDTH, WIDTH)], density=1, restitution=0.2, friction=0.3)
def marker_info(self): return create_marker_info_by_type(MARKER_ROBOT, self.zone)
def __init__(self, arena, number): GameObject.__init__(self, arena) self.marker_info = create_marker_info_by_type(MARKER_TOKEN, number) self.grabbed = False
def __init__(self, arena, number, location=(0,0), heading=0): GameObject.__init__(self, arena) self.marker_info = create_marker_info_by_type(MARKER_ARENA, number) self.location = location self.heading = heading
def __init__(self, arena, number, location=(0,0), heading=0): super(WallMarker, self).__init__(arena) self.marker_info = create_marker_info_by_type(MARKER_ARENA, number) self.location = location self.heading = heading