diff options
Diffstat (limited to 'Scenes/Entities/Player.gd')
-rw-r--r-- | Scenes/Entities/Player.gd | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/Scenes/Entities/Player.gd b/Scenes/Entities/Player.gd index 77e27b4..7c4dd02 100644 --- a/Scenes/Entities/Player.gd +++ b/Scenes/Entities/Player.gd @@ -39,6 +39,8 @@ var LAST_DIRECTIONS: Array = [] var collision_area: Area2D +var sprite_version: String = "3" + func _ready(): @@ -105,21 +107,21 @@ func _process(delta): var progress = $AnimatedSprite2D.frame_progress if velocity.x < 0 && velocity.y == 0: - $AnimatedSprite2D.play("left") + $AnimatedSprite2D.play("left_" + sprite_version) elif velocity.x > 0 && velocity.y == 0: - $AnimatedSprite2D.play("right") + $AnimatedSprite2D.play("right_" + sprite_version) elif velocity.x == 0 && velocity.y < 0: - $AnimatedSprite2D.play("up") + $AnimatedSprite2D.play("up_" + sprite_version) elif velocity.x == 0 && velocity.y > 0: - $AnimatedSprite2D.play("down") + $AnimatedSprite2D.play("down_" + sprite_version) elif velocity.x < 0 && velocity.y < 0: - $AnimatedSprite2D.play("top_left") + $AnimatedSprite2D.play("top_left_" + sprite_version) elif velocity.x > 0 && velocity.y < 0: - $AnimatedSprite2D.play("top_right") + $AnimatedSprite2D.play("top_right_" + sprite_version) elif velocity.x < 0 && velocity.y > 0: - $AnimatedSprite2D.play("bottom_left") + $AnimatedSprite2D.play("bottom_left_" + sprite_version) elif velocity.x > 0 && velocity.y > 0: - $AnimatedSprite2D.play("bottom_right") + $AnimatedSprite2D.play("bottom_right_" + sprite_version) else: play_idle() @@ -290,21 +292,21 @@ func play_idle(): #$AnimatedSprite2D.play("idle") #return if self.LAST_DIRECTIONS == [Vector2.LEFT]: - $AnimatedSprite2D.play("idle_left") + $AnimatedSprite2D.play("idle_left_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.RIGHT]: - $AnimatedSprite2D.play("idle_right") + $AnimatedSprite2D.play("idle_right_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.UP]: - $AnimatedSprite2D.play("idle_up") + $AnimatedSprite2D.play("idle_up_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.DOWN]: - $AnimatedSprite2D.play("idle_down") + $AnimatedSprite2D.play("idle_down_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.LEFT, Vector2.UP]: - $AnimatedSprite2D.play("idle_top_left") + $AnimatedSprite2D.play("idle_top_left_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.RIGHT, Vector2.UP]: - $AnimatedSprite2D.play("idle_top_right") + $AnimatedSprite2D.play("idle_top_right_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.LEFT, Vector2.DOWN]: - $AnimatedSprite2D.play("idle_bottom_left") + $AnimatedSprite2D.play("idle_bottom_left_" + sprite_version) elif self.LAST_DIRECTIONS == [Vector2.RIGHT, Vector2.DOWN]: - $AnimatedSprite2D.play("idle_bottom_right") + $AnimatedSprite2D.play("idle_bottom_right_" + sprite_version) func is_in_interaction_area(): |