Added new animations for slime.

This commit is contained in:
SnekInAScarf 2026-11-01 16:23:36 -08:00
parent 346f87831b
commit e6aaf57ec6
4 changed files with 67 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -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
}]

View file

@ -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")

View file

@ -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]