Implement skeleton combat and memory piece progression
- Created Skeleton enemy scene with idle, walk, attack, hurt, and death animations - Added player detection and enemy pursuit AI - Implemented skeleton attack system and player damage - Added player punch attack for adult character - Implemented enemy damage and health system - Added skeleton death handling - Connected MemoryPiece spawning to defeated skeletons - Added configurable memory piece textures and wardrobe assignments - Implemented memory piece collection and return-to-graveyard workflow - Added interact action to Input Map - Continued development of Wardrobe 1 combat encounter - Fixed multiple collision, hitbox, and animation issues
This commit is contained in:
parent
89c109b26f
commit
0f7889adfb
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack1.png
Normal file
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cy3t1xgbpcx1t"
|
||||||
|
path="res://.godot/imported/Skeleton_01_White_Attack1.png-69378dcabce39dcaa0f3c7adec88ef69.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack1.png"
|
||||||
|
dest_files=["res://.godot/imported/Skeleton_01_White_Attack1.png-69378dcabce39dcaa0f3c7adec88ef69.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack2.png
Normal file
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bi7xiuuca5qms"
|
||||||
|
path="res://.godot/imported/Skeleton_01_White_Attack2.png-b6b876eb7aed528f668aa8ff4f27719c.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack2.png"
|
||||||
|
dest_files=["res://.godot/imported/Skeleton_01_White_Attack2.png-b6b876eb7aed528f668aa8ff4f27719c.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Die.png
Normal file
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Die.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://den6xknhkm8d"
|
||||||
|
path="res://.godot/imported/Skeleton_01_White_Die.png-b10fe7e7b7683698319cc6cef2846031.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Die.png"
|
||||||
|
dest_files=["res://.godot/imported/Skeleton_01_White_Die.png-b10fe7e7b7683698319cc6cef2846031.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Hurt.png
Normal file
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Hurt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cxmvtyalmav26"
|
||||||
|
path="res://.godot/imported/Skeleton_01_White_Hurt.png-c21d58fbbe431a671e09d771ea6a11f1.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Hurt.png"
|
||||||
|
dest_files=["res://.godot/imported/Skeleton_01_White_Hurt.png-c21d58fbbe431a671e09d771ea6a11f1.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Idle.png
Normal file
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Idle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dcukplq3ykd13"
|
||||||
|
path="res://.godot/imported/Skeleton_01_White_Idle.png-93b14bc16022b91b131fa91b5ad0fbb8.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Idle.png"
|
||||||
|
dest_files=["res://.godot/imported/Skeleton_01_White_Idle.png-93b14bc16022b91b131fa91b5ad0fbb8.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Walk.png
Normal file
BIN
Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Walk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dilf6h30fxxw4"
|
||||||
|
path="res://.godot/imported/Skeleton_01_White_Walk.png-08707ef5a160913e911337e0bf1282d5.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Walk.png"
|
||||||
|
dest_files=["res://.godot/imported/Skeleton_01_White_Walk.png-08707ef5a160913e911337e0bf1282d5.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=45 format=4 uid="uid://8n6472fqqmcc"]
|
[gd_scene load_steps=46 format=4 uid="uid://8n6472fqqmcc"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bu6brcro3ydwf" path="res://Assets/Graphics/Terrains/Background/Graveyard/parallax-grave-bg.png" id="2_3f4w8"]
|
[ext_resource type="Texture2D" uid="uid://bu6brcro3ydwf" path="res://Assets/Graphics/Terrains/Background/Graveyard/parallax-grave-bg.png" id="2_3f4w8"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cpie2yxwj2phl" path="res://Assets/Graphics/Terrains/Background/Graveyard/parallax-grave-midder-trees.png" id="3_vi1do"]
|
[ext_resource type="Texture2D" uid="uid://cpie2yxwj2phl" path="res://Assets/Graphics/Terrains/Background/Graveyard/parallax-grave-midder-trees.png" id="3_vi1do"]
|
||||||
@ -26,6 +26,7 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://b0g2yq4wolooy" path="res://Assets/Graphics/Terrains/Background/Memories/Memory2.png" id="23_8qp07"]
|
[ext_resource type="Texture2D" uid="uid://b0g2yq4wolooy" path="res://Assets/Graphics/Terrains/Background/Memories/Memory2.png" id="23_8qp07"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d3u7nur0ua1vb" path="res://Assets/Graphics/Terrains/Background/Memories/Memory5.png" id="25_6kan1"]
|
[ext_resource type="Texture2D" uid="uid://d3u7nur0ua1vb" path="res://Assets/Graphics/Terrains/Background/Memories/Memory5.png" id="25_6kan1"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cwlxblkouwtxr" path="res://Assets/Graphics/Terrains/Background/Memories/Memory4.png" id="25_8elfy"]
|
[ext_resource type="Texture2D" uid="uid://cwlxblkouwtxr" path="res://Assets/Graphics/Terrains/Background/Memories/Memory4.png" id="25_8elfy"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://0lyd0y14s0w4" path="res://Scenes/Skeleton.tscn" id="26_pyeu7"]
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_3jtcq"]
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_3jtcq"]
|
||||||
texture = ExtResource("7_tpoa3")
|
texture = ExtResource("7_tpoa3")
|
||||||
@ -829,13 +830,6 @@ position = Vector2(3033, 212)
|
|||||||
[node name="MemoryPieces" type="Node2D" parent="."]
|
[node name="MemoryPieces" type="Node2D" parent="."]
|
||||||
position = Vector2(3784, 1095)
|
position = Vector2(3784, 1095)
|
||||||
|
|
||||||
[node name="MemoryPiece1" parent="MemoryPieces" node_paths=PackedStringArray("return_spawn", "wardrobe") instance=ExtResource("10_3jtcq")]
|
|
||||||
z_index = 10
|
|
||||||
position = Vector2(-3232, -134)
|
|
||||||
memory_texture = ExtResource("16_3jtcq")
|
|
||||||
return_spawn = NodePath("../../ReturnSpawns/ReturnSpawn1")
|
|
||||||
wardrobe = NodePath("../../Wardrobes/Wardrobe1")
|
|
||||||
|
|
||||||
[node name="MemoryPiece2" parent="MemoryPieces" node_paths=PackedStringArray("return_spawn", "wardrobe") instance=ExtResource("10_3jtcq")]
|
[node name="MemoryPiece2" parent="MemoryPieces" node_paths=PackedStringArray("return_spawn", "wardrobe") instance=ExtResource("10_3jtcq")]
|
||||||
z_index = 10
|
z_index = 10
|
||||||
position = Vector2(87, -275)
|
position = Vector2(87, -275)
|
||||||
@ -933,6 +927,13 @@ position = Vector2(2194, 239.00002)
|
|||||||
scale = Vector2(0.15, 0.15)
|
scale = Vector2(0.15, 0.15)
|
||||||
texture = ExtResource("16_dvm4i")
|
texture = ExtResource("16_dvm4i")
|
||||||
|
|
||||||
|
[node name="Skeleton" parent="Decor" node_paths=PackedStringArray("memory_return_spawn", "memory_wardrobe") instance=ExtResource("26_pyeu7")]
|
||||||
|
position = Vector2(396, 1111)
|
||||||
|
memory_piece_scene = ExtResource("10_3jtcq")
|
||||||
|
memory_texture = ExtResource("16_3jtcq")
|
||||||
|
memory_return_spawn = NodePath("../../ReturnSpawns/ReturnSpawn1")
|
||||||
|
memory_wardrobe = NodePath("../../Wardrobes/Wardrobe1")
|
||||||
|
|
||||||
[node name="Boundaries" type="Node2D" parent="."]
|
[node name="Boundaries" type="Node2D" parent="."]
|
||||||
position = Vector2(574, 596)
|
position = Vector2(574, 596)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=102 format=3 uid="uid://bu8e4iyw8pc03"]
|
[gd_scene load_steps=103 format=3 uid="uid://bu8e4iyw8pc03"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dsryf6gxqcm1k" path="res://Scripts/player.gd" id="1_0y7nr"]
|
[ext_resource type="Script" uid="uid://dsryf6gxqcm1k" path="res://Scripts/player.gd" id="1_0y7nr"]
|
||||||
[ext_resource type="Texture2D" uid="uid://rltv4cun6tyw" path="res://Assets/Graphics/Player/Death/adult death.png" id="2_nn08x"]
|
[ext_resource type="Texture2D" uid="uid://rltv4cun6tyw" path="res://Assets/Graphics/Player/Death/adult death.png" id="2_nn08x"]
|
||||||
@ -14,6 +14,9 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://lvcdluia0nr3" path="res://Assets/Graphics/Player/Child/Run/Child_run.png" id="11_1e7my"]
|
[ext_resource type="Texture2D" uid="uid://lvcdluia0nr3" path="res://Assets/Graphics/Player/Child/Run/Child_run.png" id="11_1e7my"]
|
||||||
[ext_resource type="Texture2D" uid="uid://g7bg5bcbegtv" path="res://Assets/Graphics/Player/Child/Punch/Child_punch.png" id="12_o3h8g"]
|
[ext_resource type="Texture2D" uid="uid://g7bg5bcbegtv" path="res://Assets/Graphics/Player/Child/Punch/Child_punch.png" id="12_o3h8g"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_miouo"]
|
||||||
|
size = Vector2(71, 30)
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_teras"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_teras"]
|
||||||
atlas = ExtResource("2_nn08x")
|
atlas = ExtResource("2_nn08x")
|
||||||
region = Rect2(0, 0, 123, 122)
|
region = Rect2(0, 0, 123, 122)
|
||||||
@ -319,7 +322,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_6626w")
|
"texture": SubResource("AtlasTexture_6626w")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": &"punch",
|
"name": &"punch",
|
||||||
"speed": 12.0
|
"speed": 12.0
|
||||||
}, {
|
}, {
|
||||||
@ -693,6 +696,14 @@ position = Vector2(2, -1)
|
|||||||
script = ExtResource("1_0y7nr")
|
script = ExtResource("1_0y7nr")
|
||||||
metadata/_edit_group_ = true
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="PunchHitbox" type="Area2D" parent="."]
|
||||||
|
monitoring = false
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="PunchHitbox"]
|
||||||
|
position = Vector2(50.5, -5)
|
||||||
|
shape = SubResource("RectangleShape2D_miouo")
|
||||||
|
debug_color = Color(0.97765833, 0.1351085, 0.16903454, 0.41960785)
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
position = Vector2(-7, -43)
|
position = Vector2(-7, -43)
|
||||||
|
|
||||||
@ -701,9 +712,8 @@ z_index = 10
|
|||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
position = Vector2(0, -6)
|
position = Vector2(0, -6)
|
||||||
sprite_frames = SubResource("SpriteFrames_nn08x")
|
sprite_frames = SubResource("SpriteFrames_nn08x")
|
||||||
animation = &"punch"
|
animation = &"idle"
|
||||||
autoplay = "idle"
|
autoplay = "idle"
|
||||||
frame_progress = 0.25973
|
|
||||||
|
|
||||||
[node name="ChildGraphic" type="AnimatedSprite2D" parent="."]
|
[node name="ChildGraphic" type="AnimatedSprite2D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|||||||
397
Scenes/Skeleton.tscn
Normal file
397
Scenes/Skeleton.tscn
Normal file
@ -0,0 +1,397 @@
|
|||||||
|
[gd_scene load_steps=57 format=3 uid="uid://0lyd0y14s0w4"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://f88hycnuf3m5" path="res://Scripts/skeleton.gd" id="1_abfcy"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dcukplq3ykd13" path="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Idle.png" id="1_vif15"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cy3t1xgbpcx1t" path="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Attack1.png" id="2_yek4v"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://den6xknhkm8d" path="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Die.png" id="3_2bjux"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cxmvtyalmav26" path="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Hurt.png" id="4_rtppx"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dilf6h30fxxw4" path="res://Assets/Graphics/Enemies/Skeleton/Skeleton_01_White_Walk.png" id="6_k2wj7"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_87cwn"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(0, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_lxoki"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(96, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_xneb1"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(192, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ci2ge"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(288, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ma653"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(384, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ecs23"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(480, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_0ftre"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(576, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_lii7c"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(672, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_10q1y"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(768, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_tfme2"]
|
||||||
|
atlas = ExtResource("2_yek4v")
|
||||||
|
region = Rect2(864, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_b70gm"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(0, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_t5rxt"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(96, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_y8jxr"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(192, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_7p4ha"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(288, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_jlfek"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(384, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_rsssq"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(480, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_y1shx"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(576, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_omjhr"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(672, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_8lo8o"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(768, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ijbhh"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(864, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ddipo"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(960, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_353gq"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(1056, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ix6k6"]
|
||||||
|
atlas = ExtResource("3_2bjux")
|
||||||
|
region = Rect2(1152, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_hdu5v"]
|
||||||
|
atlas = ExtResource("4_rtppx")
|
||||||
|
region = Rect2(0, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_vips4"]
|
||||||
|
atlas = ExtResource("4_rtppx")
|
||||||
|
region = Rect2(96, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_jdpkg"]
|
||||||
|
atlas = ExtResource("4_rtppx")
|
||||||
|
region = Rect2(192, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_5xlrn"]
|
||||||
|
atlas = ExtResource("4_rtppx")
|
||||||
|
region = Rect2(288, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_0i2gx"]
|
||||||
|
atlas = ExtResource("4_rtppx")
|
||||||
|
region = Rect2(384, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_abfcy"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(0, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_4ie6e"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(96, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_iuen5"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(192, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_rxd7e"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(288, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_yek4v"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(384, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_2bjux"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(480, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_rtppx"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(576, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_k2wj7"]
|
||||||
|
atlas = ExtResource("1_vif15")
|
||||||
|
region = Rect2(672, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_wx38x"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(0, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_mvwdc"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(96, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_whxj0"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(192, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_2hcwm"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(288, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_u2tho"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(384, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_14y5s"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(480, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_xuc1f"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(576, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_pdd2a"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(672, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_1xayb"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(768, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_0ba4d"]
|
||||||
|
atlas = ExtResource("6_k2wj7")
|
||||||
|
region = Rect2(864, 0, 96, 64)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_87cwn"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_87cwn")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_lxoki")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_xneb1")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ci2ge")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ma653")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ecs23")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_0ftre")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_lii7c")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_10q1y")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_tfme2")
|
||||||
|
}],
|
||||||
|
"loop": false,
|
||||||
|
"name": &"attack",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_b70gm")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_t5rxt")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_y8jxr")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_7p4ha")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_jlfek")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_rsssq")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_y1shx")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_omjhr")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_8lo8o")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ijbhh")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ddipo")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_353gq")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ix6k6")
|
||||||
|
}],
|
||||||
|
"loop": false,
|
||||||
|
"name": &"death",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_hdu5v")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_vips4")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_jdpkg")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_5xlrn")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_0i2gx")
|
||||||
|
}],
|
||||||
|
"loop": false,
|
||||||
|
"name": &"hurt",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_abfcy")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_4ie6e")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_iuen5")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_rxd7e")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_yek4v")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_2bjux")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_rtppx")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_k2wj7")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_wx38x")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_mvwdc")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_whxj0")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_2hcwm")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_u2tho")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_14y5s")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_xuc1f")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_pdd2a")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_1xayb")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_0ba4d")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"walk",
|
||||||
|
"speed": 12.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_yek4v"]
|
||||||
|
height = 72.0
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yek4v"]
|
||||||
|
size = Vector2(371, 71)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2bjux"]
|
||||||
|
size = Vector2(452, 33)
|
||||||
|
|
||||||
|
[node name="Skeleton" type="CharacterBody2D"]
|
||||||
|
z_index = 10
|
||||||
|
script = ExtResource("1_abfcy")
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
scale = Vector2(1.5, 1.5)
|
||||||
|
sprite_frames = SubResource("SpriteFrames_87cwn")
|
||||||
|
animation = &"idle"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
position = Vector2(-5, 12)
|
||||||
|
shape = SubResource("CapsuleShape2D_yek4v")
|
||||||
|
debug_color = Color(0.61885023, 0.36088452, 0.99050516, 0.41960785)
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
position = Vector2(12.5, 13.5)
|
||||||
|
shape = SubResource("RectangleShape2D_yek4v")
|
||||||
|
debug_color = Color(0.51556015, 0.56157154, 0.37343058, 0.41960785)
|
||||||
|
|
||||||
|
[node name="AttackHitbox" type="Area2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="AttackHitbox"]
|
||||||
|
position = Vector2(37, 0.5)
|
||||||
|
shape = SubResource("RectangleShape2D_2bjux")
|
||||||
|
debug_color = Color(0.9785972, 0.11901257, 0.22291586, 0.41960785)
|
||||||
@ -4,7 +4,7 @@ extends Area2D
|
|||||||
@export var memory_texture: Texture2D:
|
@export var memory_texture: Texture2D:
|
||||||
set(value):
|
set(value):
|
||||||
memory_texture = value
|
memory_texture = value
|
||||||
if $Sprite2D:
|
if has_node("Sprite2D"):
|
||||||
$Sprite2D.texture = memory_texture
|
$Sprite2D.texture = memory_texture
|
||||||
|
|
||||||
@export var return_spawn: Marker2D
|
@export var return_spawn: Marker2D
|
||||||
@ -12,22 +12,46 @@ extends Area2D
|
|||||||
|
|
||||||
@onready var sprite: Sprite2D = $Sprite2D
|
@onready var sprite: Sprite2D = $Sprite2D
|
||||||
|
|
||||||
|
var player_inside := false
|
||||||
|
var player: Player = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if memory_texture:
|
if memory_texture:
|
||||||
sprite.texture = memory_texture
|
sprite.texture = memory_texture
|
||||||
|
|
||||||
if not Engine.is_editor_hint():
|
if not Engine.is_editor_hint():
|
||||||
body_entered.connect(_on_body_entered)
|
body_entered.connect(_on_body_entered)
|
||||||
|
body_exited.connect(_on_body_exited)
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
return
|
||||||
|
|
||||||
|
if player_inside and Input.is_action_just_pressed("interact"):
|
||||||
|
collect_memory()
|
||||||
|
|
||||||
func _on_body_entered(body: Node) -> void:
|
func _on_body_entered(body: Node) -> void:
|
||||||
if body is Player:
|
if body is Player:
|
||||||
|
player_inside = true
|
||||||
|
player = body
|
||||||
|
print("Press ENTER to collect memory piece")
|
||||||
|
|
||||||
|
func _on_body_exited(body: Node) -> void:
|
||||||
|
if body is Player:
|
||||||
|
player_inside = false
|
||||||
|
player = null
|
||||||
|
|
||||||
|
func collect_memory() -> void:
|
||||||
|
if player == null:
|
||||||
|
return
|
||||||
|
|
||||||
print("Memory piece collected")
|
print("Memory piece collected")
|
||||||
|
|
||||||
if wardrobe and wardrobe.has_method("complete_wardrobe"):
|
if wardrobe and wardrobe.has_method("complete_wardrobe"):
|
||||||
wardrobe.complete_wardrobe()
|
wardrobe.complete_wardrobe()
|
||||||
|
|
||||||
if return_spawn:
|
if return_spawn:
|
||||||
body.global_position = return_spawn.global_position
|
player.global_position = return_spawn.global_position
|
||||||
else:
|
else:
|
||||||
print("No return_spawn assigned to memory piece")
|
print("No return_spawn assigned to memory piece")
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ const JUMP_VELOCITY = -400.0
|
|||||||
@onready var player_graphic: AnimatedSprite2D = $PlayerGraphic
|
@onready var player_graphic: AnimatedSprite2D = $PlayerGraphic
|
||||||
@onready var camera: Camera2D = $Camera2D
|
@onready var camera: Camera2D = $Camera2D
|
||||||
@onready var child_graphic: AnimatedSprite2D = $ChildGraphic
|
@onready var child_graphic: AnimatedSprite2D = $ChildGraphic
|
||||||
|
@onready var punch_hitbox: Area2D = $PunchHitbox
|
||||||
var using_child_form := false
|
var using_child_form := false
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +108,7 @@ func update_animation():
|
|||||||
State.DEATH:
|
State.DEATH:
|
||||||
graphic.play("death")
|
graphic.play("death")
|
||||||
State.PUNCH:
|
State.PUNCH:
|
||||||
graphic.play("Punch")
|
graphic.play("punch")
|
||||||
|
|
||||||
func handle_movement(_delta):
|
func handle_movement(_delta):
|
||||||
if direction:
|
if direction:
|
||||||
@ -121,17 +122,20 @@ func handle_movement(_delta):
|
|||||||
else:
|
else:
|
||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
|
if current_state == State.PUNCH:
|
||||||
|
velocity.x = 0
|
||||||
|
return
|
||||||
|
|
||||||
func handle_input():
|
func handle_input():
|
||||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
if Input.is_action_just_pressed("jump") and is_on_floor():
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
current_state = State.JUMP
|
current_state = State.JUMP
|
||||||
upJump = true
|
upJump = true
|
||||||
|
|
||||||
# Child punch attack
|
|
||||||
if Input.is_action_just_pressed("attack"):
|
if Input.is_action_just_pressed("attack"):
|
||||||
print("ATTACK PRESSED")
|
print("ATTACK PRESSED")
|
||||||
print("using_child_form =", using_child_form)
|
|
||||||
current_state = State.PUNCH
|
current_state = State.PUNCH
|
||||||
|
_do_punch_damage()
|
||||||
|
|
||||||
if Input.is_action_just_pressed("shove") && pushEnabled:
|
if Input.is_action_just_pressed("shove") && pushEnabled:
|
||||||
print("shove pressed")
|
print("shove pressed")
|
||||||
@ -182,8 +186,8 @@ const STAIRS_LAYER := 3 # correct layer number for "stairs"
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_set_stair_collision(false)
|
_set_stair_collision(false)
|
||||||
# Allow climbing up steeper slopes (default is ~45°)
|
floor_max_angle = deg_to_rad(60)
|
||||||
floor_max_angle = deg_to_rad(60) # you can increase or decrease as needed
|
punch_hitbox.monitoring = false
|
||||||
|
|
||||||
func set_camera_limits(left: int, top: int, right: int, bottom: int) -> void:
|
func set_camera_limits(left: int, top: int, right: int, bottom: int) -> void:
|
||||||
camera.limit_left = left
|
camera.limit_left = left
|
||||||
@ -242,6 +246,24 @@ func on_stairs_top_reached(stairs: Node) -> void:
|
|||||||
if stairs_node == stairs and is_on_stairs:
|
if stairs_node == stairs and is_on_stairs:
|
||||||
_end_stairs_mode()
|
_end_stairs_mode()
|
||||||
|
|
||||||
|
func _do_punch_damage() -> void:
|
||||||
|
print("Punch damage started")
|
||||||
|
|
||||||
|
punch_hitbox.monitoring = true
|
||||||
|
await get_tree().physics_frame
|
||||||
|
|
||||||
|
var bodies = punch_hitbox.get_overlapping_bodies()
|
||||||
|
print("Punch overlaps: ", bodies.size())
|
||||||
|
|
||||||
|
for body in bodies:
|
||||||
|
print("Punch hit: ", body.name)
|
||||||
|
|
||||||
|
if body.has_method("take_damage"):
|
||||||
|
body.take_damage(1)
|
||||||
|
|
||||||
|
await get_tree().create_timer(0.1).timeout
|
||||||
|
punch_hitbox.monitoring = false
|
||||||
|
|
||||||
func _on_animation_finished() -> void:
|
func _on_animation_finished() -> void:
|
||||||
match current_state:
|
match current_state:
|
||||||
State.JUMP:
|
State.JUMP:
|
||||||
|
|||||||
149
Scripts/skeleton.gd
Normal file
149
Scripts/skeleton.gd
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
@export var speed := 75.0
|
||||||
|
@export var gravity := 980.0
|
||||||
|
@export var max_health := 3
|
||||||
|
@export var attack_range := 40.0
|
||||||
|
@export var memory_piece_scene: PackedScene
|
||||||
|
@export var memory_texture: Texture2D
|
||||||
|
@export var memory_return_spawn: Marker2D
|
||||||
|
@export var memory_wardrobe: Node2D
|
||||||
|
|
||||||
|
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||||
|
@onready var detection_area: Area2D = $Area2D
|
||||||
|
@onready var attack_hitbox = $AttackHitbox
|
||||||
|
|
||||||
|
|
||||||
|
var health := 3
|
||||||
|
var player: Player = null
|
||||||
|
var is_dead := false
|
||||||
|
var is_hurt := false
|
||||||
|
var is_attacking := false
|
||||||
|
var attack_cooldown := false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
health = max_health
|
||||||
|
attack_hitbox.monitoring = false
|
||||||
|
sprite.play("idle")
|
||||||
|
|
||||||
|
detection_area.body_entered.connect(_on_detection_body_entered)
|
||||||
|
detection_area.body_exited.connect(_on_detection_body_exited)
|
||||||
|
|
||||||
|
sprite.animation_finished.connect(_on_animation_finished)
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
if is_dead:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not is_on_floor():
|
||||||
|
velocity.y += gravity * delta
|
||||||
|
|
||||||
|
if is_hurt or is_attacking:
|
||||||
|
velocity.x = 0
|
||||||
|
move_and_slide()
|
||||||
|
return
|
||||||
|
|
||||||
|
if player:
|
||||||
|
var direction := player.global_position.x - global_position.x
|
||||||
|
|
||||||
|
if abs(direction) > attack_range:
|
||||||
|
velocity.x = sign(direction) * speed
|
||||||
|
sprite.play("walk")
|
||||||
|
|
||||||
|
if velocity.x < 0:
|
||||||
|
sprite.flip_h = true
|
||||||
|
elif velocity.x > 0:
|
||||||
|
sprite.flip_h = false
|
||||||
|
else:
|
||||||
|
velocity.x = 0
|
||||||
|
attack()
|
||||||
|
else:
|
||||||
|
velocity.x = move_toward(velocity.x, 0, speed)
|
||||||
|
sprite.play("idle")
|
||||||
|
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
func attack() -> void:
|
||||||
|
if is_attacking:
|
||||||
|
return
|
||||||
|
if attack_cooldown:
|
||||||
|
return
|
||||||
|
is_attacking = true
|
||||||
|
attack_cooldown = true
|
||||||
|
velocity.x = 0
|
||||||
|
sprite.play("attack")
|
||||||
|
|
||||||
|
await get_tree().create_timer(0.2).timeout
|
||||||
|
|
||||||
|
do_attack_damage()
|
||||||
|
|
||||||
|
func do_attack_damage() -> void:
|
||||||
|
print("Checking attack hit")
|
||||||
|
|
||||||
|
attack_hitbox.monitoring = true
|
||||||
|
await get_tree().physics_frame
|
||||||
|
await get_tree().physics_frame
|
||||||
|
|
||||||
|
var bodies = attack_hitbox.get_overlapping_bodies()
|
||||||
|
print("Bodies found: ", bodies.size())
|
||||||
|
|
||||||
|
for body in bodies:
|
||||||
|
if body is Player:
|
||||||
|
print("PLAYER HIT")
|
||||||
|
body.playerTakesDamage(1)
|
||||||
|
|
||||||
|
attack_hitbox.monitoring = false
|
||||||
|
|
||||||
|
func take_damage(amount: int = 1) -> void:
|
||||||
|
if is_dead:
|
||||||
|
return
|
||||||
|
|
||||||
|
health -= amount
|
||||||
|
print("Skeleton health:", health)
|
||||||
|
|
||||||
|
if health <= 0:
|
||||||
|
die()
|
||||||
|
else:
|
||||||
|
is_hurt = true
|
||||||
|
velocity.x = 0
|
||||||
|
sprite.play("hurt")
|
||||||
|
|
||||||
|
func die() -> void:
|
||||||
|
if is_dead:
|
||||||
|
return
|
||||||
|
|
||||||
|
is_dead = true
|
||||||
|
velocity.x = 0
|
||||||
|
sprite.play("death")
|
||||||
|
print("Skeleton died")
|
||||||
|
|
||||||
|
func _on_detection_body_entered(body: Node) -> void:
|
||||||
|
if body is Player:
|
||||||
|
player = body
|
||||||
|
print("Skeleton detected player")
|
||||||
|
|
||||||
|
func _on_detection_body_exited(body: Node) -> void:
|
||||||
|
if body == player:
|
||||||
|
player = null
|
||||||
|
print("Skeleton lost player")
|
||||||
|
|
||||||
|
func _on_animation_finished() -> void:
|
||||||
|
if sprite.animation == "hurt":
|
||||||
|
is_hurt = false
|
||||||
|
|
||||||
|
if sprite.animation == "attack":
|
||||||
|
is_attacking = false
|
||||||
|
await get_tree().create_timer(1.0).timeout
|
||||||
|
attack_cooldown = false
|
||||||
|
|
||||||
|
if sprite.animation == "death":
|
||||||
|
if memory_piece_scene:
|
||||||
|
var piece = memory_piece_scene.instantiate()
|
||||||
|
get_parent().add_child(piece)
|
||||||
|
piece.global_position = global_position
|
||||||
|
|
||||||
|
piece.memory_texture = memory_texture
|
||||||
|
piece.return_spawn = memory_return_spawn
|
||||||
|
piece.wardrobe = memory_wardrobe
|
||||||
|
|
||||||
|
queue_free()
|
||||||
1
Scripts/skeleton.gd.uid
Normal file
1
Scripts/skeleton.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://f88hycnuf3m5
|
||||||
@ -19,7 +19,7 @@ func _ready() -> void:
|
|||||||
area.body_exited.connect(_on_body_exited)
|
area.body_exited.connect(_on_body_exited)
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
if player_inside and not completed and Input.is_action_just_pressed("ui_up"):
|
if player_inside and not completed and Input.is_action_just_pressed("interact"):
|
||||||
enter_wardrobe()
|
enter_wardrobe()
|
||||||
|
|
||||||
func _on_body_entered(body: Node) -> void:
|
func _on_body_entered(body: Node) -> void:
|
||||||
|
|||||||
@ -49,7 +49,42 @@ shoot={
|
|||||||
}
|
}
|
||||||
attack={
|
attack={
|
||||||
"deadzone": 0.2,
|
"deadzone": 0.2,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
interact={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_left={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_right={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_up={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_down={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
jump={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user