Ejemplo n.º 1
0
 def __init__(self, ID, color, size, position, heading=0):
     BaseSprite.__init__(self, size, position, heading)
     self.ID = ID
     p = os.path.join('images', 'Robot.png')
     img = Image.open(p)
     draw = ImageDraw.Draw(img)
     font = ImageFont.truetype('Arial_Bold.ttf', 14)
     draw.text((7,1), ID, color, font)
     self.image_origin = pygame.image.frombuffer(img.tostring(),
                                                 img.size, img.mode)
     self.image_origin = self.image_origin.convert_alpha()
     self.image = pygame.transform.scale(self.image_origin, size)
     self.image = pygame.transform.rotate(self.image, heading)
     self.rect = self.image.get_rect()
     self.size = size
Ejemplo n.º 2
0
 def __init__(self, start_pos, size):
     BaseSprite.__init__(self, start_pos, size)
     self.points = 0
Ejemplo n.º 3
0
 def __init__(self, name, size, position, heading=0):
     BaseSprite.__init__(self, size, position, heading, 'Ball.png')
     self.name = name
     self.score_red = 0
     self.score_blue = 0
     self.t0 = time.time()
Ejemplo n.º 4
0
 def __init__(self, start_pos, size):
     BaseSprite.__init__(self, start_pos, size)
     self.top = False
Ejemplo n.º 5
0
 def __init__(self, start_pos, size):
     BaseSprite.__init__(self, start_pos, size)
     self.top = False
Ejemplo n.º 6
0
 def __init__(self, start_pos, size):
     BaseSprite.__init__(self, start_pos, (size, size))
     self.angle = math.radians(45)
     self.speed = 6.0