Exemple #1
0
 def __new__(cls):
     "méthode de construction standard en Python"
     if cls.instance is None:
         cls.instance = object.__new__(cls)
         cls.sprites = SpriteSheetLoader('../res/Ascii.png', 16, 16,
                                         True).getSpriteList()
     return cls.instance
Exemple #2
0
 def load(self, is_left_player):
     self.sprites = SpriteSheetLoader('img//superpower.png', 60,
                                      60).getSpriteList()
     self.spriteline = self.player_idx - 1
     self.spritecolumn = 0
     if is_left_player:
         self.hitbox = Hitbox(30, 25, Point(45, 180), True)
     else:
         self.hitbox = Hitbox(30, 25, Point(245, 180), False)
Exemple #3
0
 def __init__(self, position, screen, screenManager, soundManager, cursor):
     self.sprites = SpriteSheetLoader('img/Ascii.png', 16,
                                      16).getSpriteList()
     self.screen = screen
     self.screenManager = screenManager
     self.soundManager = soundManager
     self.position = position
     self.options = []
     self.cursor = pygame.image.load(cursor).convert_alpha()
     self.choice = 0
Exemple #4
0
 def load(self, is_left_player):
     self.sprites = SpriteSheetLoader(
         'personagens//' + str(self.index) + '//sprites.png', 120,
         100).getSpriteList()
     self.spriteline = 0
     self.spritecolumn = 0
     if is_left_player:
         self.hitbox = Hitbox(30, 40, Point(45, 200), True)
     else:
         self.hitbox = Hitbox(30, 40, Point(245, 200), False)
     self.health = HealthBar(is_left_player)
     self.power_bar = PowerBar(is_left_player)
     self.superpower = SuperPower(self.index)
     self.superpower.load(is_left_player)
Exemple #5
0
 def __init__(self, string, position):
     self.string = string
     self.position = position
     self.letters = SpriteSheetLoader('img/Ascii.png', 16, 16,
                                      True).getSpriteList()
     self.sprite = self.convert()