Better combo
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 7.4 KiB |
BIN
gamedata/assets/player/combo/5.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
gamedata/assets/player/combo/6.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
@ -71,6 +71,7 @@ class Player(Movable):
|
||||
|
||||
self.combo = 0
|
||||
self.combosprites = self.game.getSpriteDir("player/combo/")
|
||||
self.combotimer = 1
|
||||
|
||||
def step(self):
|
||||
|
||||
@ -126,6 +127,8 @@ class Player(Movable):
|
||||
self.attackstate(self) # Si je suis sur le sol
|
||||
self.onground = False
|
||||
self.onceilling = False
|
||||
if self.combotimer>=0:
|
||||
self.combotimer-=self.game.dt*5
|
||||
# Cancel fastfall if not enough speed
|
||||
if abs(self.verspd)<5:
|
||||
self.fastfall = 0
|
||||
@ -233,12 +236,13 @@ class Player(Movable):
|
||||
|
||||
def upcombo(self):
|
||||
|
||||
if self.combotimer<=0:
|
||||
# Up the combo and spawn particles
|
||||
if self.combo>=1:
|
||||
index = min(self.combo-1,len(self.combosprites)-1)
|
||||
self.game.addParticle([self.combosprites[index]],self.rect.center[0],self.rect.top,fps=1)
|
||||
|
||||
self.combo+=1
|
||||
self.combotimer = 1
|
||||
|
||||
def draw(self):
|
||||
flipy = (self.gravityway<0 and not self.leaptimer<0)
|
||||
|