Some sprite fixes

This commit is contained in:
2026-06-28 19:11:28 +03:00
parent 43518b3c9e
commit 204546b93a
2 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -53,7 +53,8 @@ func _ready() -> void:
for sprite : AnimatedSprite2D in [ attack_left_sprite, attack_right_sprite ]: for sprite : AnimatedSprite2D in [ attack_left_sprite, attack_right_sprite ]:
var lambda := func() -> void: var lambda := func() -> void:
sprite.hide() sprite.hide()
blade_sprite.show() if not is_zero_approx(velocity.x):
blade_sprite.show()
sprite.animation_finished.connect(lambda) sprite.animation_finished.connect(lambda)
sprite.hide() sprite.hide()
+5 -5
View File
@@ -114,16 +114,16 @@ region = Rect2(160, 96, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_bhunq"] [sub_resource type="SpriteFrames" id="SpriteFrames_bhunq"]
animations = [{ animations = [{
"frames": [{ "frames": [{
"duration": 10.0, "duration": 30.0,
"texture": SubResource("AtlasTexture_cjfdk") "texture": SubResource("AtlasTexture_cjfdk")
}, { }, {
"duration": 3.0, "duration": 10.0,
"texture": SubResource("AtlasTexture_p5qu6") "texture": SubResource("AtlasTexture_p5qu6")
}, { }, {
"duration": 10.0, "duration": 30.0,
"texture": SubResource("AtlasTexture_cjfdk") "texture": SubResource("AtlasTexture_cjfdk")
}, { }, {
"duration": 3.0, "duration": 10.0,
"texture": SubResource("AtlasTexture_heu0c") "texture": SubResource("AtlasTexture_heu0c")
}], }],
"loop": 1, "loop": 1,
@@ -508,7 +508,7 @@ shape = SubResource("CapsuleShape2D_bhunq")
[node name="PlayerSprite" type="AnimatedSprite2D" parent="." unique_id=2025942250] [node name="PlayerSprite" type="AnimatedSprite2D" parent="." unique_id=2025942250]
sprite_frames = SubResource("SpriteFrames_bhunq") sprite_frames = SubResource("SpriteFrames_bhunq")
animation = &"jump_right" animation = &"idle"
[node name="BladeSprite" type="AnimatedSprite2D" parent="." unique_id=1561250707] [node name="BladeSprite" type="AnimatedSprite2D" parent="." unique_id=1561250707]
position = Vector2(0, 8) position = Vector2(0, 8)