Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 def marker_info(self):
     return create_marker_info_by_type(MARKER_ROBOT, self.zone)
Example #4
0
 def __init__(self, arena, number):
     GameObject.__init__(self, arena)
     self.marker_info = create_marker_info_by_type(MARKER_TOKEN, number)
     self.grabbed = False
Example #5
0
 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
Example #6
0
 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
Example #7
0
 def marker_info(self):
     return create_marker_info_by_type(MARKER_ROBOT, self.zone)
Example #8
0
 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