diff options
Diffstat (limited to 'Characters')
-rw-r--r-- | Characters/Character.gd | 6 | ||||
-rw-r--r-- | Characters/Character.tscn | 20 | ||||
-rw-r--r-- | Characters/Tux.tscn | 30 |
3 files changed, 28 insertions, 28 deletions
diff --git a/Characters/Character.gd b/Characters/Character.gd index 966d69d..e5623b1 100644 --- a/Characters/Character.gd +++ b/Characters/Character.gd @@ -35,6 +35,9 @@ func _physics_process(_delta): $Sprite.play("idle") + velocity = move_and_slide(velocity, Vector2.UP) + + # jump and fall animation if not is_on_floor(): $Sprite.play("jump") @@ -83,9 +86,6 @@ func _physics_process(_delta): $Sprite.flip_h = true - velocity = move_and_slide(velocity, Vector2.UP) - - # stop velocity.x = lerp(velocity.x, 0, 0.7) diff --git a/Characters/Character.tscn b/Characters/Character.tscn index a444463..5b94efc 100644 --- a/Characters/Character.tscn +++ b/Characters/Character.tscn @@ -14,6 +14,11 @@ [sub_resource type="SpriteFrames" id=1] animations = [ { +"frames": [ ExtResource( 2 ) ], +"loop": true, +"name": "idle", +"speed": 5.0 +}, { "frames": [ ExtResource( 8 ) ], "loop": true, "name": "slide", @@ -24,16 +29,6 @@ animations = [ { "name": "back", "speed": 5.0 }, { -"frames": [ ExtResource( 2 ) ], -"loop": true, -"name": "idle", -"speed": 5.0 -}, { -"frames": [ ExtResource( 7 ) ], -"loop": true, -"name": "jump", -"speed": 5.0 -}, { "frames": [ ExtResource( 5 ), ExtResource( 6 ) ], "loop": true, "name": "walk", @@ -54,6 +49,11 @@ animations = [ { "name": "fall_stop", "speed": 5.0 }, { +"frames": [ ExtResource( 7 ) ], +"loop": true, +"name": "jump", +"speed": 5.0 +}, { "frames": [ ExtResource( 3 ) ], "loop": true, "name": "wall", diff --git a/Characters/Tux.tscn b/Characters/Tux.tscn index aaffa33..b3f110a 100644 --- a/Characters/Tux.tscn +++ b/Characters/Tux.tscn @@ -14,14 +14,14 @@ [sub_resource type="SpriteFrames" id=1] animations = [ { -"frames": [ ExtResource( 4 ) ], +"frames": [ ExtResource( 2 ) ], "loop": true, -"name": "back", +"name": "idle", "speed": 5.0 }, { -"frames": [ ExtResource( 2 ) ], +"frames": [ ExtResource( 4 ) ], "loop": true, -"name": "idle", +"name": "back", "speed": 5.0 }, { "frames": [ ExtResource( 7 ) ], @@ -29,14 +29,19 @@ animations = [ { "name": "jump", "speed": 5.0 }, { +"frames": [ ExtResource( 10 ) ], +"loop": false, +"name": "fall_stop", +"speed": 5.0 +}, { "frames": [ ExtResource( 5 ), ExtResource( 6 ) ], "loop": true, "name": "walk", "speed": 5.0 }, { -"frames": [ ExtResource( 11 ) ], +"frames": [ ExtResource( 9 ) ], "loop": true, -"name": "fall_stop_landing", +"name": "fall", "speed": 5.0 }, { "frames": [ ExtResource( 8 ) ], @@ -44,19 +49,14 @@ animations = [ { "name": "run", "speed": 5.0 }, { -"frames": [ ExtResource( 9 ) ], +"frames": [ ExtResource( 3 ) ], "loop": true, -"name": "fall", -"speed": 5.0 -}, { -"frames": [ ExtResource( 10 ) ], -"loop": false, -"name": "fall_stop", +"name": "wall", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ) ], +"frames": [ ExtResource( 11 ) ], "loop": true, -"name": "wall", +"name": "fall_stop_landing", "speed": 5.0 } ] |