Added dust particles
This commit is contained in:
parent
25ba8131bc
commit
c1ab414aeb
BIN
gamedata/assets/particles/dust/0.png
Normal file
BIN
gamedata/assets/particles/dust/0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 664 B |
BIN
gamedata/assets/particles/dust/1.png
Normal file
BIN
gamedata/assets/particles/dust/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 720 B |
BIN
gamedata/assets/particles/dust/2.png
Normal file
BIN
gamedata/assets/particles/dust/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 725 B |
BIN
gamedata/assets/particles/dust/3.png
Normal file
BIN
gamedata/assets/particles/dust/3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 689 B |
BIN
gamedata/assets/particles/dust/4.png
Normal file
BIN
gamedata/assets/particles/dust/4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 644 B |
@ -8,6 +8,8 @@ class Ennemy(Movable):
|
|||||||
|
|
||||||
self.player = None
|
self.player = None
|
||||||
|
|
||||||
|
self.dustparticles = game.getSpriteDir("particles/dust/")
|
||||||
|
|
||||||
def step(self):
|
def step(self):
|
||||||
|
|
||||||
super().step()
|
super().step()
|
||||||
@ -19,6 +21,9 @@ class Ennemy(Movable):
|
|||||||
if self.rect.colliderect(self.player.hitrect):
|
if self.rect.colliderect(self.player.hitrect):
|
||||||
# Die
|
# Die
|
||||||
self.game.gameloop.delid(self.id)
|
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
|
# Boost the player vertically
|
||||||
if not self.player.fastfall:
|
if not self.player.fastfall:
|
||||||
if self.player.rect[1]>self.rect[1]:
|
if self.player.rect[1]>self.rect[1]:
|
||||||
|
@ -20,6 +20,8 @@ class Player(Movable):
|
|||||||
self.hitrect[3] = round(self.hitrect[3]*0.7)
|
self.hitrect[3] = round(self.hitrect[3]*0.7)
|
||||||
self.canhit = False
|
self.canhit = False
|
||||||
|
|
||||||
|
self.dustparticles = game.getSpriteDir("particles/dust/")
|
||||||
|
|
||||||
self.speed = 200
|
self.speed = 200
|
||||||
self.controlled = True
|
self.controlled = True
|
||||||
|
|
||||||
@ -91,7 +93,10 @@ class Player(Movable):
|
|||||||
self.onground = True
|
self.onground = True
|
||||||
self.candash = True
|
self.candash = True
|
||||||
self.canfastfall = 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:
|
if self.gravityway > 0:
|
||||||
self.verspd=min(0,self.verspd)
|
self.verspd=min(0,self.verspd)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user