Better combo

This commit is contained in:
theo@manjaro 2021-11-18 09:28:47 +01:00
parent a7bbf99399
commit 5b326bda81
6 changed files with 10 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -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):
# 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
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)