Exemple #1
0
 def __init__(self, yPos):
     GameElement.__init__(self)
     self.image, self.rect = self.load_image('fist.bmp', -1)
     screen = pygame.display.get_surface()
     
     self.yPos = yPos
     self.area = screen.get_rect()
     
     self.image = pygame.transform.rotate(self.image, 90)
     self.rect = self.image.get_rect()
     self.rect.centery = self.yPos
     self.rect.centerx = self.area.centerx
 def __init__(self):
     # GameElement.__init__(self)
     GameElement.__init__(self)
     self.image, self.rect = self.load_image('nicubunu_Monkey_head.png', -1)
     self.image = pygame.transform.scale(self.image, (25, 25))
     self.rect = self.image.get_rect()
     
     self.slope = 3
     screen = pygame.display.get_surface()
     self.area = screen.get_rect()
     self.speed = -3
     self.rect.center = self.area.center
     self.rect.y = self.area.height - 2 * self.rect.h
     self.resetState = True
Exemple #3
0
class Block(GameElement):
    """
    This describes a Block of the breakout game
    """


    def __init__(self, (centerX, centerY)):
        """
        Constructor
        """
        GameElement.__init__(self)
        self.image, self.rect = self.load_image('nicubunu_Banana.png', -1)
        self.hp = 1
        self.rect.center = (centerX, centerY)