From f416c2b3cd1b18ae67ce006ae10f9c8e94ce3f51 Mon Sep 17 00:00:00 2001 From: Jacalz Date: Thu, 28 Jan 2021 12:00:45 +0100 Subject: [PATCH] Fix chameleon movement with controller --- Enteties/Chameleon/Chameleon.tscn | 20 ++++++++++---------- Enteties/Chameleon/chameleon.gd | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Enteties/Chameleon/Chameleon.tscn b/Enteties/Chameleon/Chameleon.tscn index ad03408..895676e 100644 --- a/Enteties/Chameleon/Chameleon.tscn +++ b/Enteties/Chameleon/Chameleon.tscn @@ -18,6 +18,16 @@ [sub_resource type="SpriteFrames" id=1] animations = [ { +"frames": [ ExtResource( 6 ), ExtResource( 9 ) ], +"loop": true, +"name": "Walk_evolved", +"speed": 6.0 +}, { +"frames": [ ExtResource( 2 ), ExtResource( 3 ) ], +"loop": true, +"name": "Walk", +"speed": 6.0 +}, { "frames": [ ExtResource( 10 ) ], "loop": false, "name": "Jump", @@ -33,16 +43,6 @@ animations = [ { "name": "Jump_evolved", "speed": 1.0 }, { -"frames": [ ExtResource( 6 ), ExtResource( 9 ) ], -"loop": true, -"name": "Walk_evolved", -"speed": 6.0 -}, { -"frames": [ ExtResource( 2 ), ExtResource( 3 ) ], -"loop": true, -"name": "Walk", -"speed": 6.0 -}, { "frames": [ ExtResource( 4 ) ], "loop": false, "name": "Idle", diff --git a/Enteties/Chameleon/chameleon.gd b/Enteties/Chameleon/chameleon.gd index b8f5886..b96821a 100644 --- a/Enteties/Chameleon/chameleon.gd +++ b/Enteties/Chameleon/chameleon.gd @@ -35,7 +35,7 @@ func _on_evolving(): evolve_anim = "_evolved" func horizontal_move(direction: int): - sprite.flip_h = direction == 1 + sprite.flip_h = direction > 0 sprite.play("Walk" + evolve_anim) camo.disable()