Exemplo n.º 1
0
    def spawn_player_debris(self, x, y, image, number):

        for i in xrange(number):
            size = choice([2, 4, 6, 8, 10])
            debris = Particle(x, y, size, size, image)
            debris.hspeed = choice([-5, -4, -3, -2, 2, 3, 4, 5])
            debris.vspeed = choice([-5, -4, -3, -2, 2, 3, 4, 5])
            debris.hspeed *= 1.5
            debris.vspeed *= 1.5
            debris.gravity = 0
            debris.fade = True
            debris.friction = 0.010 * 2
            self.particles.add(debris)
Exemplo n.º 2
0
    def restructure_player(self, x, y, image, number, sprite_group, kill_time):
        for i in xrange(number):
            size = choice([2, 4, 6, 8, 10])
            debris = Particle(x, y, size, size, image)
            debris.hspeed = choice([-4, -3, -2, 2, 3, 4])
            debris.vspeed = choice([-4, -3, -2, 2, 3, 4])
            debris.gravity = 0
            debris.fade = False

            for i in range(GAME.fps/2):
                debris.fade = False
                debris.update()
                debris.timeout = 0
            debris.multiplier = kill_time
            debris.hspeed = -debris.hspeed
            debris.vspeed = -debris.vspeed

            self.particles.add(debris)
            sprite_group.add(debris)