예제 #1
0
 class __Dino:
     def __init__(self, nom, coord=(0, 0), selectionne=False):
         self.surface = Images().charger_image(
             f'res/img/interfaces/selection/choix-dino-{nom}.png'
         ).convert_alpha()
         self.surface_transparent = self.surface.copy()
         self.surface_transparent.fill((255, 255, 255, 70), None,
                                       pygame.BLEND_RGBA_MULT)
         self.selectionne = selectionne
         self.coord = coord
         self.nom = nom
예제 #2
0
    class __Coeur:
        def __init__(self, i, coord=(0, 0), selectionne=False):
            self.surface = Images().charger_image(
                'res/img/hud/coeur-rouge.bmp').convert_alpha()
            self.surface_transparent = self.surface.copy()
            self.surface_transparent.fill((255, 255, 255, 70), None,
                                          pygame.BLEND_RGBA_MULT)
            self.selectionne = selectionne
            self.coord = coord
            self.index = i + 1

        def collision(self, point):
            rect = self.surface.get_rect()
            rect.x, rect.y = self.coord

            return rect.collidepoint(point)