示例#1
0
 def __init__(self, pic_params = {'name': 'boot.gif', 'colorkey': -1}, initial_pos = (0,0), direction = common.DIRECTION_LEFT, groups = [], sons = 0, alpha = 255, alpha_drop = 85, delay = 0, first = True, ignore_dir = False):
     GameSprite.__init__(self, pic_params, initial_pos, direction, groups, sons, alpha, alpha_drop, delay, first, ignore_dir)
     self.last_time = pygame.time.get_ticks()
     self.speed = self.BOOT_INITIAL_SPEED
     self.angle = 0
     self.original_image = self.image
     self.damage = 2
     if first:
         common.play_sfx('kick.wav')
示例#2
0
    def __init__(self, initial_pos, direction):
        try:
            if FireBall.images == None:
                FireBall.images = common.load_animation(self.FIREBALL_BASENAME, -1)
        except AttributeError:
            FireBall.images = common.load_animation(self.FIREBALL_BASENAME, -1)
        common.AnimatedSprite.__init__(self, FireBall.images, 10)
        self.rect.midleft = initial_pos
        self.direction = direction
        if self.direction == common.DIRECTION_LEFT:
            self.images = [pygame.transform.flip(image, True, False) for image in self.images]
            self.rect.midright = self.rect.midleft

        common.play_sfx('hadouken.wav')
        self.damage = 10            
示例#3
0
    def __init__(self, initial_pos, direction):
        try:
            if Dragon.images == None:
                Dragon.images = common.load_animation('dragon', -1, pixel_location = (725, 0))
        except AttributeError:
            Dragon.images = common.load_animation('dragon', -1, pixel_location = (725, 0))
        common.AnimatedSprite.__init__(self, Dragon.images, 9)
        self.rect.top = 0
        self.rect.center = initial_pos[0], self.rect.center[1]
        self.direction = direction
        if self.direction == common.DIRECTION_LEFT:
            self.images = [pygame.transform.flip(image, True, False) for image in self.images]
            self.rect.move_ip((50,0))
        else:
            self.rect.move_ip((-50,0))

        self.damage = 40

        self.sfx = common.play_sfx('roar.wav')
示例#4
0
 def __init__(self, pic_params = {'name': 'fist.png', 'alpha': True}, initial_pos = (0,0), direction = common.DIRECTION_LEFT, groups = [], sons = 0, alpha = 255, alpha_drop = 85, delay = 0, first = True, ignore_dir = False):
     GameSprite.__init__(self, pic_params, initial_pos, direction, groups, sons, alpha, alpha_drop, delay, first, ignore_dir)
     self.speed = self.FIST_INITIAL_SPEED
     self.damage = 2
     if first:
         common.play_sfx('punch.wav')
示例#5
0
 def __init__(self, pic_params, initial_pos, direction, groups, sons = 0, alpha = 255, alpha_drop = 85, delay = 0, first = True, ignore_dir = True):
     GameSprite.__init__(self, pic_params, initial_pos, direction, groups, sons, alpha, alpha_drop, delay, first, ignore_dir)
     self.last_time = pygame.time.get_ticks()
     self.speed = self.SHADOW_INITIAL_SPEED
     self.damage = 20
     common.play_sfx('whoosh.wav')