From 0d568d9359b6dd49212905d0e597188b20de0810 Mon Sep 17 00:00:00 2001 From: Lucas Peter Date: Tue, 23 Jul 2024 12:15:28 +0200 Subject: [PATCH] Add a slow walk --- player.tscn | 55 +++++++++++++++++++++------------ player/animations/Walk.res | 4 +-- player/animations/WalkLeft.res | 4 +-- player/animations/WalkRight.res | 4 +-- player/animations/idle.res | 4 +-- 5 files changed, 44 insertions(+), 27 deletions(-) diff --git a/player.tscn b/player.tscn index cc4e79d..87f866e 100644 --- a/player.tscn +++ b/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=3 uid="uid://0m1hk2nu4bps"] +[gd_scene load_steps=23 format=3 uid="uid://0m1hk2nu4bps"] [ext_resource type="Script" path="res://player.gd" id="1_0pgv8"] [ext_resource type="Texture2D" uid="uid://5pmqr3y62guu" path="res://player/currentCloth.tres" id="2_45h8h"] @@ -464,6 +464,19 @@ nodes/TimeScale/position = Vector2(140, 120) nodes/output/position = Vector2(280, 120) node_connections = [&"TimeScale", 0, &"Animation", &"output", 0, &"TimeScale"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3ity4"] +animation = &"Walk" + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_lyqpn"] + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_5jdm6"] +graph_offset = Vector2(-329, 172) +nodes/Animation/node = SubResource("AnimationNodeAnimation_3ity4") +nodes/Animation/position = Vector2(-120, 220) +nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_lyqpn") +nodes/TimeScale/position = Vector2(60, 220) +node_connections = [&"TimeScale", 0, &"Animation", &"output", 0, &"TimeScale"] + [sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_c82tj"] blend_point_0/node = SubResource("AnimationNodeAnimation_paj7q") blend_point_0/pos = 0.0 @@ -471,6 +484,8 @@ blend_point_1/node = SubResource("AnimationNodeAnimation_w0twr") blend_point_1/pos = 500.0 blend_point_2/node = SubResource("AnimationNodeBlendTree_p4347") blend_point_2/pos = 700.0 +blend_point_3/node = SubResource("AnimationNodeBlendTree_5jdm6") +blend_point_3/pos = 20.0 min_space = 0.0 max_space = 700.0 snap = 10.0 @@ -478,6 +493,7 @@ value_label = "speed" sync = true [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_wgp38"] +graph_offset = Vector2(-108, 70) nodes/WalkRun/node = SubResource("AnimationNodeBlendSpace1D_c82tj") nodes/WalkRun/position = Vector2(180, 120) nodes/output/position = Vector2(440, 120) @@ -514,30 +530,32 @@ playback_default_blend_time = 0.3 [node name="AnimationTree" type="AnimationTree" parent="." groups=["Animation"]] tree_root = SubResource("AnimationNodeBlendTree_wgp38") anim_player = NodePath("../AnimationPlayer") -parameters/WalkRun/blend_position = 178.271 +parameters/WalkRun/blend_position = 20.1713 parameters/WalkRun/2/TimeScale/scale = 1.8 +parameters/WalkRun/3/TimeScale/scale = 0.3 [node name="Skeleton2D" type="Skeleton2D" parent="."] position = Vector2(17, 0) [node name="BootL" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(-5.61248, -38.9448) -rotation = 0.142016 -region_enabled = true -region_rect = Rect2(896, 768, 128, 128) -metadata/Type = "Skin" - -[node name="BootR" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(-31.9509, -45.6022) -rotation = -0.232808 +position = Vector2(-77.0483, -35.8612) +rotation = 0.298037 scale = Vector2(1, 1) texture = ExtResource("2_45h8h") region_enabled = true region_rect = Rect2(896, 768, 128, 128) metadata/Type = "Skin" +[node name="BootR" type="Sprite2D" parent="Skeleton2D"] +position = Vector2(26.6367, -42.0048) +rotation = -0.528737 +texture = ExtResource("2_45h8h") +region_enabled = true +region_rect = Rect2(896, 768, 128, 128) +metadata/Type = "Skin" + [node name="Body" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(51, -229.397) +position = Vector2(51, -242.284) texture = ExtResource("2_45h8h") offset = Vector2(-15, 0) region_enabled = true @@ -545,7 +563,7 @@ region_rect = Rect2(0, 640, 384, 384) metadata/Type = "Skin" [node name="HandL" type="Sprite2D" parent="Skeleton2D/Body"] -position = Vector2(-20.1603, 51.5819) +position = Vector2(-3, 54) texture = ExtResource("2_45h8h") region_enabled = true region_rect = Rect2(768, 768, 128, 128) @@ -553,7 +571,7 @@ metadata/Type = "Skin" [node name="HandR" type="Sprite2D" parent="Skeleton2D/Body"] show_behind_parent = true -position = Vector2(-154.264, 30.3642) +position = Vector2(-160, 29) texture = ExtResource("2_45h8h") region_enabled = true region_rect = Rect2(768, 768, 128, 128) @@ -561,9 +579,8 @@ metadata/Type = "Skin" [node name="Tail" type="Sprite2D" parent="Skeleton2D/Body"] show_behind_parent = true -position = Vector2(44, 99.3973) -rotation = -0.090184 -scale = Vector2(1, 1) +position = Vector2(44, 112.284) +rotation = 0.153589 texture = ExtResource("2_45h8h") offset = Vector2(70, 0) region_enabled = true @@ -571,8 +588,8 @@ region_rect = Rect2(768, 640, 256, 128) metadata/Type = "Skin" [node name="Head" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(-40, -402.397) -rotation = 0.0243178 +position = Vector2(-40, -415.284) +rotation = 0.0557601 texture = ExtResource("2_45h8h") offset = Vector2(0, -168) region_enabled = true diff --git a/player/animations/Walk.res b/player/animations/Walk.res index fdac958..58db0b4 100644 --- a/player/animations/Walk.res +++ b/player/animations/Walk.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3dc57aeb85162e28218ecf17150b21827bef262a10bdcab077c321cad53c495 -size 1833 +oid sha256:bceb866aa8f92153c8c47be186b545b7efa5d7c595e8f914580e084a92b36d23 +size 1832 diff --git a/player/animations/WalkLeft.res b/player/animations/WalkLeft.res index 2d999d1..d1ef888 100644 --- a/player/animations/WalkLeft.res +++ b/player/animations/WalkLeft.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07d8882c60e6f472e0e811e3db4c12c02ebb3e27c8040eeae69c34e826815c74 -size 1755 +oid sha256:a63b51e105c26cef448856e8ce262949181c67f23b57bb547ff8ed8bab56c416 +size 1753 diff --git a/player/animations/WalkRight.res b/player/animations/WalkRight.res index 3b2d6ce..62988f7 100644 --- a/player/animations/WalkRight.res +++ b/player/animations/WalkRight.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d4577879ae4ddd28b842ee1565b59f97c0a2db70cbcd1dab6f1b2194a9e132d -size 1753 +oid sha256:06568bc975a45ab2ebefbb58ef18f951fa357c8b374c9525a1e73f9e209827fb +size 1752 diff --git a/player/animations/idle.res b/player/animations/idle.res index 93b2d04..84f86a1 100644 --- a/player/animations/idle.res +++ b/player/animations/idle.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0cd989c7127fc633c1c5c62b87f50cb9f974338bdd42209c40af92975952791f -size 1969 +oid sha256:9b4f4701a1df9b7e7178da31ce3bc91a5cc51617003e0d7632162e63761fc96d +size 1987