Added dust particles

This commit is contained in:
theo@manjaro 2021-11-17 15:16:07 +01:00
parent 25ba8131bc
commit c1ab414aeb
7 changed files with 11 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

View File

@ -8,6 +8,8 @@ class Ennemy(Movable):
self.player = None
self.dustparticles = game.getSpriteDir("particles/dust/")
def step(self):
super().step()
@ -19,6 +21,9 @@ class Ennemy(Movable):
if self.rect.colliderect(self.player.hitrect):
# Die
self.game.gameloop.delid(self.id)
# Add particles
self.game.addParticle(self.dustparticles,self.rect.center[0],self.rect.center[1])
# Boost the player vertically
if not self.player.fastfall:
if self.player.rect[1]>self.rect[1]:

View File

@ -20,6 +20,8 @@ class Player(Movable):
self.hitrect[3] = round(self.hitrect[3]*0.7)
self.canhit = False
self.dustparticles = game.getSpriteDir("particles/dust/")
self.speed = 200
self.controlled = True
@ -91,7 +93,10 @@ class Player(Movable):
self.onground = True
self.candash = True
self.canfastfall = True
self.fastfall = False
if self.fastfall:
self.fastfall = False
# Spawns dust
self.game.addParticle(self.dustparticles,self.rect.center[0],self.rect.bottom,fps=25)
if self.gravityway > 0:
self.verspd=min(0,self.verspd)
else: