Example #1
0
    def __init__(self, x, y, width, height, frames):
        self.frames = frames
        image = frames[0]
        PhysicsBody.__init__(self, x, y, width, height, image)
        self.bounds = pygame.sprite.Group()
        self.changeDirection = False
        self.angle = 0

        self.hspeed = choice([-3, -2, 2, 3])
        self.index = 0
        self.frame = 0
Example #2
0
    def __init__(self, x, y, width, height, image):
        PhysicsBody.__init__(self, x, y, width, height, image)
        self.image.set_colorkey(COLOR.black)
        self.frameNumber = 0
        self.speed = 3
        self.timeout = 0
        self.captured = False
        self.safe = False
        self.givePoint = False
        self.id = 0
        self.killer_group = pygame.sprite.Group()
        self.storage_group = pygame.sprite.Group()

        self.dead_sound = mixer.Sound(os.path.join("assets", "sfx", "data_explode.wav"))
        self.point_sound = mixer.Sound(os.path.join("assets", "sfx", "sfx_zap.ogg"))
        self.dead_sound.set_volume(0.4)
        self.point_sound.set_volume(0.5)
Example #3
0
    def __init__(self, x, y , width, height, animationFrames, id):
        mixer.init()
        image = animationFrames
        PhysicsBody.__init__(self, x, y, width, height, image)
        self.jumpHeight = PLAYER.jump
        self.speed = PLAYER.speed
        self.has_data = False
        self.shoot_data = False
        self.direction = DIRECTION.left
        self.id = id
        self.hurt = False
        self.dead = False
        self.cooldown = 0
        self.frozen = False
        self.respawn = False
        self.reconstruct = False
        self.reconstruction_timer = 2.5
        self.blink_timer = 0
        self.label = PhysicsBody(0, 0, 17, 12, PLAYER.p1_label)
        self.glow = PhysicsBody(0, 0, 48, 48, ASSET.player1_glow)
        self.blink = PhysicsBody(0, 0, 32, 32, ASSET.player_hurt)
        self.original_image = self.image
        self.danger_group = pygame.sprite.Group()
        self.particle_group = pygame.sprite.Group()
        
        self.sort_players()
        self.update_label()
        self.original_glow_image = self.glow.image
        self.original_blink_image = self.blink.image
        self.respawn_position = x, y
        self.death_pos = self.rect.centerx, self.rect.centery

        self.controller1 = self.get_controller(1)
        self.controller2 = self.get_controller(2)

        self.dead_sound = mixer.Sound(os.path.join("assets", "sfx", "sfx_lose.ogg"))
        self.dead_sound.set_volume(0.5)
        self.consume_sound = mixer.Sound(os.path.join("assets", "sfx", "sfx_shieldUp.ogg"))
        self.consume_sound.set_volume(0.3)
        self.throw_sound = mixer.Sound(os.path.join("assets", "sfx", "sfx_shieldDown.ogg"))
        self.throw_sound.set_volume(0.3)
Example #4
0
    def __init__(self, x, y, width, height, frames):
        image = frames.get_walk_frames()[0]
        PhysicsBody.__init__(self, x, y, width, height, image)

        self.hspeed = choice([-1, 1])
Example #5
0
 def __init__(self, x, y, width, height, image):
     PhysicsBody.__init__(self, x, y, width, height, image)