Double Tap pour Fastfall si on tombe d'un semi

This commit is contained in:
theo@manjaro 2021-07-09 10:04:17 +02:00
parent b8285755ae
commit 63b10f7aad

View File

@ -56,12 +56,15 @@ class Player(Movable):
# Je passe en dessous des semi-plateformes
if keys["down"]["timer"]==1:
falled = False
if not self.checkcollisions(0,1,semi=False):
semi = self.checkcollisions(0,1,classic=False)
if semi!=self.checkcollisions(0,0,classic=False) and semi:
self.rect.bottom = semi.top+1
if 0<self.verspd <= self.fastfallmargin or (abs(self.verspd)<abs(self.currentspdv) and abs(self.verspd)<=self.fastfallmargin/1.8):
self.verspd = self.maxgravity/4
falled = True
if not falled:
if 0<self.verspd <= self.fastfallmargin or (abs(self.verspd)<abs(self.currentspdv) and abs(self.verspd)<=self.fastfallmargin/1.8):
self.verspd = self.maxgravity/4
else:
if self.hitposetimer.tick(self.game.dt):