I already did a jumping system which is working, but i have to do one using mecanics. At the moment my character never come back to the ground. Here is my code :
def jump(self):
if self.isJumping == False:
self.isJumping = True
self.velx = math.cos(self.alpha) * self.v0
self.vely = math.sin(self.alpha) * self.v0
else:
self.time += 0.01
distX = self.speed * self.velx * self.time
distY = self.speed * self.vely * self.time - (((self.time ** 2) * self.gravity) / 2)
self.rect.x = round(distX + self.rect.x)
self.rect.y = round(self.rect.y + distY)
And there is a part of the init of my player class:
self.isJumping = False
self.v0 = 1
self.alpha = 5
self.time = 0
self.velx = 0
self.vely = 0
self.gravity = 1
Thanks for helping !