Skip to content

Commit

Permalink
Fix jumping / falling texture in platformer example.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvcraven committed Mar 9, 2020
1 parent 94b9b6a commit ef83c13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arcade/examples/platform_tutorial/11_animate_character.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ def update_animation(self, delta_time: float = 1/60):
return

# Jumping animation
if self.jumping and not self.is_on_ladder:
if self.change_y >= 0:
self.texture = self.jump_texture_pair[self.character_face_direction]
else:
self.texture = self.fall_texture_pair[self.character_face_direction]
if self.change_y > 0 and not self.is_on_ladder:
self.texture = self.jump_texture_pair[self.character_face_direction]
return
elif self.change_y < 0 and not self.is_on_ladder:
self.texture = self.fall_texture_pair[self.character_face_direction]
return

# Idle animation
Expand Down

0 comments on commit ef83c13

Please sign in to comment.