dada
parent
4119d7a27c
commit
1e9744384b
4
main.py
4
main.py
|
|
@ -123,7 +123,6 @@ class Player:
|
||||||
self.x = WIDTH
|
self.x = WIDTH
|
||||||
|
|
||||||
def apply_gravity(self):
|
def apply_gravity(self):
|
||||||
|
|
||||||
self.prev_y = self.y
|
self.prev_y = self.y
|
||||||
self.y_velocity += GRAVITY
|
self.y_velocity += GRAVITY
|
||||||
self.y += self.y_velocity
|
self.y += self.y_velocity
|
||||||
|
|
@ -133,6 +132,9 @@ class Player:
|
||||||
self.y_velocity = 0
|
self.y_velocity = 0
|
||||||
self.jumping = False
|
self.jumping = False
|
||||||
|
|
||||||
|
if self.y < 0:
|
||||||
|
self.y = 0
|
||||||
|
self.y_velocity = 0
|
||||||
def update_animation(self):
|
def update_animation(self):
|
||||||
if self.jumping:
|
if self.jumping:
|
||||||
up_thresh = -self.jump_power * 0.4
|
up_thresh = -self.jump_power * 0.4
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue