From ef83c13624d374b8ab9004409ea9d750afc91a11 Mon Sep 17 00:00:00 2001 From: Paul Vincent Craven Date: Mon, 9 Mar 2020 10:08:36 -0500 Subject: [PATCH] Fix jumping / falling texture in platformer example. --- .../examples/platform_tutorial/11_animate_character.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arcade/examples/platform_tutorial/11_animate_character.py b/arcade/examples/platform_tutorial/11_animate_character.py index c050e9bf1..d4b2717b5 100644 --- a/arcade/examples/platform_tutorial/11_animate_character.py +++ b/arcade/examples/platform_tutorial/11_animate_character.py @@ -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