From e6aaf57ec6dabe5b8019a1f92f07904a20a9cfad Mon Sep 17 00:00:00 2001 From: SnekInAScarf Date: Sun, 1 Nov 2026 16:23:36 -0800 Subject: [PATCH] Added new animations for slime. --- Assets/Player.png | Bin 1373 -> 2045 bytes Assets/slime_player.tres | 56 ++++++++++++++++++++++++++++++++++++--- Characters/player.gd | 14 +++++++++- Characters/player.tscn | 3 +-- 4 files changed, 67 insertions(+), 6 deletions(-) diff --git a/Assets/Player.png b/Assets/Player.png index 3bb321a7cce00100e593d507f86cd1e1089f78f1..873c86fdce88d202e2878e8ad5afd872dd3fc362 100755 GIT binary patch delta 999 zcmV3jGfuiBL{Q4GJ0x0000DNk~Le000620000W2m=5B08^DP*Rdfd1b+jc zNklRxK; zrCv$@-ymBGJxVE$R|;(sXvPLZ*NyBBXhr1r^X z&?&a7Tg&?kHh*whENr|J11}YLM`(Rbu-@T; zgX;Sf39Bt}HeH1wgg*WQ3aoya0IGWmWG(1inStq_Fc@ zfT@DI32?Oi4S*6LgCNHb>;YK<86c})Q^Sm|(zn@PF@(8lc?pn182MX=zkZAWX6O(o z7NmBQ4Sz?Otzg0o3_}djn@)m|-3o#Yp}8JPfl~-@SXs*uH_VZC{_{Arr1T%QJ-RD#B&++Wd;u&#)U%Eg;W5dnE{TA6n~v~sRC>wgy)_SLvG?= z734Aqp8!-6!q=KFB_<2HfGRi#2Dq+LiL)K|0`EH%0V#Vn2j$J-_ivout_vK&c1I*w zCDy#RVV>VuUgG{Oh7m!#0b7qs0CP3MK~V|EeR7yQ4M2#$3qzm~Y(wzpu!|}t0Zh>= z03g5|N(_*%4m?f(-m5@PaqrInI2&9LAt6;#i%kSzIeM6lty2J8%kv8G7+wfl{sCm@ VVAKHPXsG}I002ovPDHLkV1f#1xMu(W delta 322 zcmV-I0lohH58VnOiBL{Q4GJ0x0000DNk~Le0001V0000W2m=5B0Q6g|^syl)1b+bk zNklRon`U%V%Xy$gx>QUvIj`IV4u3|}qW0i@#LH>m%oHS*D>JwdXzXA9F!%2i-H0k( zt|`36N7()~mQ#S8qzs@*YV1RlBgpYUiz*YdFJ#-G;shXWM%px4uDCZC+yjQz;co2# zeTtKDVk0c5<8 UyMp{`umAu607*qoM6N<$f_}4=YXATM 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]