diff options
-rw-r--r-- | Characters/Character.gd | 6 | ||||
-rw-r--r-- | Characters/Character.tscn | 20 | ||||
-rw-r--r-- | Characters/Tux.tscn | 30 | ||||
-rw-r--r-- | Levels/Level.gd | 3 | ||||
-rw-r--r-- | Objects/CheckFall.gd (renamed from CheckFall.gd) | 0 | ||||
-rw-r--r-- | Objects/CheckFall.tscn | 2 |
6 files changed, 30 insertions, 31 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 } ] diff --git a/Levels/Level.gd b/Levels/Level.gd index 34463b6..7544dd9 100644 --- a/Levels/Level.gd +++ b/Levels/Level.gd @@ -2,10 +2,9 @@ extends Node2D var idx = 0 +var timer = 0 var HUD = CanvasLayer.new() - -var timer = 0 var LabelTimer = preload("res://UI/HUD/Timer.tscn").instance() var LevelMap = preload("res://UI/HUD/LevelMap.tscn").instance() diff --git a/CheckFall.gd b/Objects/CheckFall.gd index ff28fc0..ff28fc0 100644 --- a/CheckFall.gd +++ b/Objects/CheckFall.gd diff --git a/Objects/CheckFall.tscn b/Objects/CheckFall.tscn index 58da76e..526c2e3 100644 --- a/Objects/CheckFall.tscn +++ b/Objects/CheckFall.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://CheckFall.gd" type="Script" id=1] +[ext_resource path="res://Objects/CheckFall.gd" type="Script" id=1] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 384, 10 ) |