def __init__(self, x, y, r=50):
     super(Planet, self).__init__(x, y, r)
     particles = ps.Sun()
     particles.start_color = ps.Color(0.5, 0.5, 0.5, 1.0)
     particles.size = r * 2
     self.add(particles)
     self.instances.append(self)
Example #2
0
 def __init__(self, x, y, r):
     super(Obstacle, self).__init__()
     self.position = (x, y)
     self.radius = r
     particles = ps.Sun()
     particles.size = r * 2
     particles.start_color = ps.Color(0.0, 0.7, 0.0, 1.0)
     self.add(particles)
     self.instances.append(self)
Example #3
0
 def __init__(self):
     super(MainLayer, self).__init__()
     self.target = ps.Sun()
     self.target.position = (40, 40)
     self.target.start_color = ps.Color(0.2, 0.7, 0.7, 1.0)
     self.target.velocity = eu.Vector2(50, 0)
     self.add(self.target)
     self.actor = Actor(320, 240)
     self.actor.target = self.target
     self.add(self.actor)
     self.schedule(self.update)
class ActorExplosion(ps.ParticleSystem):
    total_particles = 400
    duration = 0.1
    gravity = eu.Point2(0, 0)
    angle = 90.0
    angle_var = 360.0
    speed = 40.0
    speed_var = 20.0
    life = 3.0
    life_var = 1.5
    emission_rate = total_particles / duration
    start_color_var = ps.Color(0.0, 0.0, 0.0, 0.2)
    end_color = ps.Color(0.0, 0.0, 0.0, 1.0)
    end_color_var = ps.Color(0.0, 0.0, 0.0, 0.0)
    size = 15.0
    size_var = 10.0
    blend_additive = True

    def __init__(self, pos, particles):
        super(ActorExplosion, self).__init__()
        self.position = pos
        self.start_color = particles.start_color
class PickupParticles(ps.Sun):
    size = 20
    start_color = ps.Color(0.7, 0.7, 0.2, 1.0)