def loadImages(cls): super(Player, cls).loadImages() cls.images['upright'] = loadframes("gunstar", ["gunup1.png", "gunup2.png"]) cls.images['upleft'] = flippedframes(cls.images['upright']) cls.images['upsideright'] = loadframes( "gunstar", ["gunupside1.png", "gunupside2.png"]) cls.images['upsideleft'] = flippedframes(cls.images['upsideright']) cls.images['sideright'] = loadframes("gunstar", ["gunside1.png", "gunside2.png"]) cls.images['sideleft'] = flippedframes(cls.images['sideright']) cls.images['downsideright'] = loadframes( "gunstar", ["gundownside1.png", "gundownside2.png"]) cls.images['downsideleft'] = flippedframes(cls.images['downsideright']) cls.images['downright'] = loadframes("gunstar", ["gundown1.png", "gundown2.png"]) cls.images['downleft'] = flippedframes(cls.images['downright']) cls.images['idleright'] = loadframes("gunstar", ["rest1.png", "rest2.png"]) cls.images['idleleft'] = flippedframes(cls.images['idleright']) cls.images['runright'] = loadframes("gunstar", n_of("run%i.png", 6)) cls.images['runleft'] = flippedframes(cls.images['runright']) cls.images['jumpright'] = loadframes("gunstar", ["jump1.png", "jump2.png"]) cls.images['jumpleft'] = flippedframes(cls.images['jumpright']) cls.images['fallright'] = loadframes("gunstar", ["jump3.png"]) cls.images['fallleft'] = flippedframes(cls.images['fallright']) cls.images['hitright'] = loadframes("gunstar", ["hit1.png", "hit2.png"]) cls.images['hitleft'] = flippedframes(cls.images['hitright'])
def __init__(self, screen): super(InstructionsScene, self).__init__(screen) self.image = loadframes('gunstar', ('gunside1.png',))[0] self.image = pygame.transform.scale2x(pygame.transform.scale2x(self.image)) # x4! self.soldier = loadframes('soldier', ('rest1.gif',))[0] self.chopper = loadframes('copter', ('fly1.gif',))[0] self.ghost = loadframes('ghost', ('right1.gif',))[0]
def __init__(self, screen): super(InstructionsScene, self).__init__(screen) self.image = loadframes('gunstar', ('gunside1.png', ))[0] self.image = pygame.transform.scale2x( pygame.transform.scale2x(self.image)) # x4! self.soldier = loadframes('soldier', ('rest1.gif', ))[0] self.chopper = loadframes('copter', ('fly1.gif', ))[0] self.ghost = loadframes('ghost', ('right1.gif', ))[0]
def __init__(self, max_hearts): import os self.full = loadframes('assorted', ['heartfull.gif'])[0] self.full = pygame.transform.scale( self.full, (self.full.get_width() * 2, self.full.get_height() * 2)) self.empty = loadframes('assorted', ['heartempty.gif'])[0] self.empty = pygame.transform.scale( self.empty, (self.empty.get_width() * 2, self.empty.get_height() * 2)) self.rect = pygame.rect.Rect((0, 0), (0, 0)) self.max_hearts = max_hearts self.current_hearts = max_hearts self.redraw = True
def loadImages(cls): super(Player, cls).loadImages() cls.images['upright'] = loadframes("gunstar", ["gunup1.png", "gunup2.png"]) cls.images['upleft'] = flippedframes(cls.images['upright']) cls.images['upsideright'] = loadframes("gunstar", ["gunupside1.png", "gunupside2.png"]) cls.images['upsideleft'] = flippedframes(cls.images['upsideright']) cls.images['sideright'] = loadframes("gunstar", ["gunside1.png", "gunside2.png"]) cls.images['sideleft'] = flippedframes(cls.images['sideright']) cls.images['downsideright'] = loadframes("gunstar", ["gundownside1.png", "gundownside2.png"]) cls.images['downsideleft'] = flippedframes(cls.images['downsideright']) cls.images['downright'] = loadframes("gunstar", ["gundown1.png", "gundown2.png"]) cls.images['downleft'] = flippedframes(cls.images['downright']) cls.images['idleright'] = loadframes("gunstar", ["rest1.png", "rest2.png"]) cls.images['idleleft'] = flippedframes(cls.images['idleright']) cls.images['runright'] = loadframes("gunstar", n_of("run%i.png", 6)) cls.images['runleft'] = flippedframes(cls.images['runright']) cls.images['jumpright'] = loadframes("gunstar", ["jump1.png", "jump2.png"]) cls.images['jumpleft'] = flippedframes(cls.images['jumpright']) cls.images['fallright'] = loadframes("gunstar", ["jump3.png"]) cls.images['fallleft'] = flippedframes(cls.images['fallright']) cls.images['hitright'] = loadframes("gunstar", ["hit1.png", "hit2.png"]) cls.images['hitleft'] = flippedframes(cls.images['hitright'])
def loadImages(cls): super(Heart, cls).loadImages() heart_frames = [1, 2, 3, 4, 5, 4, 3, 2] cls.images['heart'] = loadframes( "assorted", ["heart%d.gif" % i for i in heart_frames])
def loadImages(cls): super(Shotgun, cls).loadImages() cls.images['shotgun'] = loadframes("assorted", ("shotgun1.gif", ))
def loadImages(cls): super(Heart, cls).loadImages() heart_frames = [1, 2, 3, 4, 5, 4, 3, 2] cls.images['heart'] = loadframes("assorted", ["heart%d.gif" % i for i in heart_frames])
def loadImages(cls): super(Shotgun, cls).loadImages() cls.images['shotgun'] = loadframes("assorted", ("shotgun1.gif",))