forked from ayte/PinmikPanik
Added little ghosts on death
This commit is contained in:
parent
1ea4887a38
commit
9750efeb63
BIN
gamedata/assets/particles/ghost/0.png
Normal file
BIN
gamedata/assets/particles/ghost/0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 650 B |
BIN
gamedata/assets/particles/ghost/1.png
Normal file
BIN
gamedata/assets/particles/ghost/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 645 B |
@ -101,6 +101,10 @@ class Lemming(BaseObject):
|
||||
for vely in range(-1,2):
|
||||
self.game.addParticle(sprites,self.rect.center[0],self.rect.center[1],velx=velx/2,vely=vely/2)
|
||||
|
||||
# Spawn little ghost
|
||||
sprites = self.game.getSpriteDir("particles/ghost/")
|
||||
self.game.addParticle(sprites,self.rect.center[0],self.rect.center[1],fps=2,vely=-1)
|
||||
|
||||
def launch(self):
|
||||
# Launch itself in the mouse direction
|
||||
xdiff = self.game.inputs["mouse"]["pos"][0]-self.rect.center[0]
|
||||
|
@ -60,7 +60,7 @@ class Manager(BaseObject):
|
||||
# Game over
|
||||
if self.endtimer.tick(self.game.dt):
|
||||
self.game.globals["score"] = int(self.score)
|
||||
self.game.scenes.gameover(self.game)
|
||||
self.game.scene = self.game.scenes.gameover
|
||||
|
||||
if self.invincible:
|
||||
if self.deathtimer.tick(self.game.dt):
|
||||
@ -101,6 +101,8 @@ class Manager(BaseObject):
|
||||
self.game.realwindow.blit(txtsurfacelives,[20,20*2+txtsurfacescore.get_height()])
|
||||
|
||||
self.endrect.set_alpha((1-self.endtimer.getratio())*255)
|
||||
if self.endtimer.getloops()>=1:
|
||||
self.endrect.set_alpha(255)
|
||||
self.game.realwindow.blit(self.endrect,[0,0])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user