diff --git a/Assets/Player.png b/Assets/Player.png index 3bb321a..873c86f 100755 Binary files a/Assets/Player.png and b/Assets/Player.png differ diff --git a/Assets/slime_player.tres b/Assets/slime_player.tres index 1e7b92a..6efd1ac 100755 --- a/Assets/slime_player.tres +++ b/Assets/slime_player.tres @@ -4,15 +4,35 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_65ufv"] atlas = ExtResource("1_qkju4") -region = Rect2(0, 0, 38, 32) +region = Rect2(0, 0, 64, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qkju4"] +atlas = ExtResource("1_qkju4") +region = Rect2(448, 0, 64, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_vhg5s"] atlas = ExtResource("1_qkju4") -region = Rect2(39, 0, 38, 32) +region = Rect2(64, 0, 64, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_lrw40"] atlas = ExtResource("1_qkju4") -region = Rect2(78, 0, 38, 32) +region = Rect2(128, 0, 64, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ygdw1"] +atlas = ExtResource("1_qkju4") +region = Rect2(320, 0, 64, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2f2n7"] +atlas = ExtResource("1_qkju4") +region = Rect2(384, 0, 64, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_umadm"] +atlas = ExtResource("1_qkju4") +region = Rect2(192, 0, 64, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hy70p"] +atlas = ExtResource("1_qkju4") +region = Rect2(256, 0, 64, 32) [resource] animations = [{ @@ -26,6 +46,14 @@ animations = [{ }, { "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_qkju4") +}], +"loop": 1, +"name": &"InAir", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("AtlasTexture_65ufv") }, { "duration": 1.0, @@ -40,4 +68,26 @@ animations = [{ "loop": 1, "name": &"Moving", "speed": 7.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ygdw1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2f2n7") +}], +"loop": 1, +"name": &"ReachX", +"speed": 4.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_umadm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hy70p") +}], +"loop": 1, +"name": &"ReachY", +"speed": 4.0 }] diff --git a/Characters/player.gd b/Characters/player.gd index 926bf86..9f82b3b 100755 --- a/Characters/player.gd +++ b/Characters/player.gd @@ -175,10 +175,22 @@ func _update_facing(xInput: float, yInput: float) -> void: sprite.flip_h = xInput < 0 func _update_animation(xInput:float, yInput:float): - if xInput and (isStickingToCeiling or is_on_floor()): + if xInput and (isStickingToCeiling or is_on_floor()) and timeSpentHoldingEdge == 0: sprite.play("Moving") elif yInput and isStickingToWall: sprite.play("Moving") + + elif !is_on_floor() and !isStickingToWall and !isStickingToCeiling: + sprite.play("InAir") + + elif (is_on_floor() or isStickingToCeiling) and timeSpentHoldingEdge > 0: + sprite.play("ReachX") + + elif ((is_on_floor() and timeSpentHoldingUpOnFloor > 0) or + (isStickingToCeiling and timeSpentUnstickingCeiling > 0)): + sprite.play("ReachY") + elif isStickingToWall and timeSpentUnstickingWall > 0: + sprite.play("ReachY") else: sprite.play("Idle") diff --git a/Characters/player.tscn b/Characters/player.tscn index 905f9b5..207b16a 100755 --- a/Characters/player.tscn +++ b/Characters/player.tscn @@ -18,8 +18,7 @@ landSounds = Array[AudioStream]([ExtResource("3_land1"), ExtResource("4_land2"), [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=402647784] sprite_frames = ExtResource("5_4m0gv") -animation = &"Moving" -frame_progress = 0.92610025 +animation = &"ReachY" offset = Vector2(0, -6) [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1379572123]