|
|
|
@ -14,13 +14,12 @@ class Particle:
|
|
|
|
|
self.timer = randint(10,40) |
|
|
|
|
def draw(self,window): |
|
|
|
|
for i in range(5): #+ randint(-30,30) |
|
|
|
|
pygame.draw.rect(window,(255,255,255),(self.rect[0] + randint(-30,30), self.rect[1] + randint(-30,30), self.rect[2], self.rect[3])) |
|
|
|
|
pygame.draw.rect(window,(randint(200,255),randint(170,255),20),(self.rect[0] + randint(-35,35), self.rect[1] + randint(-30,30), self.rect[2], self.rect[3])) |
|
|
|
|
def update(self): |
|
|
|
|
for particle in particles_on_screen: |
|
|
|
|
self.timer -= 0.5 |
|
|
|
|
#self.x += self.vel - randint(1,2) |
|
|
|
|
self.rect[1] += int(randint(-2,2)) #self.vel + |
|
|
|
|
self.rect[0] += int(randint(-1,1)) |
|
|
|
|
self.rect[1] += self.vel + int(randint(-6,1)) #self.vel + |
|
|
|
|
self.rect[0] += self.vel + int(randint(-1,1)) |
|
|
|
|
if particle.timer <= 0: |
|
|
|
|
particles_on_screen.remove(particle) |
|
|
|
|
#print('Particles :',str(len(particles_on_screen))) |
|
|
|
|