player hurt working with signals

This commit is contained in:
OddlyTimbot committed 2024-10-07 14:24:38 -04:00
1 parent a6fc6acc12
commit 6355c31a7c
6 files changed
+101 -8

No files matched your search

+38 -2
View File
@@ -1,9 +1,10 @@
[gd_scene load_steps=39 format=3 uid="uid://dbgc24hrbtvxm"]
[gd_scene load_steps=44 format=3 uid="uid://dbgc24hrbtvxm"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_5qpif"]
[ext_resource type="Texture2D" uid="uid://d6d3re6epsh4" path="res://assets/graphics/player/death/Player Death 64x64.png" id="2_t1yra"]
[ext_resource type="Texture2D" uid="uid://pdvgf3y1lquv" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_vcmr0"]
[ext_resource type="Texture2D" uid="uid://cvh48exhs1ir1" path="res://assets/graphics/player/run/player run 48x48.png" id="3_a03rx"]
[ext_resource type="Texture2D" uid="uid://b2brlauvni08o" path="res://assets/graphics/player/hurt/Player Hurt 48x48.png" id="3_a70o5"]
[ext_resource type="Texture2D" uid="uid://d0kfe5ms2vjbr" path="res://assets/graphics/player/jump/player jump 48x48.png" id="3_mvdmt"]
[sub_resource type="AtlasTexture" id="AtlasTexture_uru55"]
@@ -46,6 +47,22 @@ region = Rect2(384, 0, 48, 48)
atlas = ExtResource("2_t1yra")
region = Rect2(432, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_me361"]
atlas = ExtResource("3_a70o5")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_5yslj"]
atlas = ExtResource("3_a70o5")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8y4s"]
atlas = ExtResource("3_a70o5")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_vc70i"]
atlas = ExtResource("3_a70o5")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_etdvv"]
atlas = ExtResource("2_vcmr0")
region = Rect2(0, 0, 48, 48)
@@ -169,6 +186,23 @@ animations = [{
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_me361")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5yslj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l8y4s")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vc70i")
}],
"loop": false,
"name": &"hurt",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_etdvv")
}, {
"duration": 1.0,
@@ -256,7 +290,7 @@ metadata/_edit_group_ = true
texture_filter = 1
position = Vector2(0, -7)
sprite_frames = SubResource("SpriteFrames_wlxdo")
animation = &"death"
animation = &"hurt"
autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
@@ -274,3 +308,5 @@ position = Vector2(12, -5)
[node name="MarkerLeft" type="Node2D" parent="."]
position = Vector2(-15, -5)
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]