GodotGameWorkshop/Scenes/Characters/Demon.tscn
doctorbatmanwho-creator 13f95562a7 Implemented demon enemy combat, enemy knockback, and directional player attacks
- Added Demon enemy scene with detection, pursuit, attack, hurt, and death states
- Configured Demon collision layers, detection area, and attack hitbox
- Fixed Demon movement to pursue player horizontally and attack at close range
- Allowed enemy/player overlap for melee combat encounters
- Added enemy damage and death handling
- Added knockback system for enemies when hit
- Fixed player punch hitbox positioning based on facing direction
- Corrected directional melee attacks so enemies can be hit from both left and right sides
- Fixed collision mask issues affecting floors and enemy detection
- Improved memory piece pickup interaction to support button-based collection
- Continued testing and debugging combat interactions in Graveyard and Demon levels
2026-06-18 20:27:14 -04:00

264 lines
7.3 KiB
Plaintext

[gd_scene load_steps=38 format=3 uid="uid://mpbyvdlj8q0v"]
[ext_resource type="Script" uid="uid://cukuvefvrcr3f" path="res://Scripts/demon.gd" id="1_02sxe"]
[ext_resource type="Texture2D" uid="uid://c5k5805pwyb5q" path="res://Assets/Graphics/Enemies/Demon/IDLE.png" id="1_nr56x"]
[ext_resource type="Texture2D" uid="uid://s1yejx4rd7w5" path="res://Assets/Graphics/Enemies/Demon/ATTACK.png" id="1_yqejl"]
[ext_resource type="Texture2D" uid="uid://ucdnvhxv3qmr" path="res://Assets/Graphics/Enemies/Demon/DEATH.png" id="2_02sxe"]
[ext_resource type="Texture2D" uid="uid://0b1xky08ou2a" path="res://Assets/Graphics/Enemies/Demon/FLYING.png" id="3_ohyyq"]
[ext_resource type="Texture2D" uid="uid://7jepws8n5v7q" path="res://Assets/Graphics/Enemies/Demon/HURT.png" id="4_w1cra"]
[sub_resource type="AtlasTexture" id="AtlasTexture_5rfnd"]
atlas = ExtResource("1_yqejl")
region = Rect2(0, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_ig148"]
atlas = ExtResource("1_yqejl")
region = Rect2(81, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_nbb7h"]
atlas = ExtResource("1_yqejl")
region = Rect2(162, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_20pyc"]
atlas = ExtResource("1_yqejl")
region = Rect2(243, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_p746w"]
atlas = ExtResource("1_yqejl")
region = Rect2(324, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_3xtmj"]
atlas = ExtResource("1_yqejl")
region = Rect2(405, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_alngn"]
atlas = ExtResource("1_yqejl")
region = Rect2(486, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_eayuf"]
atlas = ExtResource("1_yqejl")
region = Rect2(567, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_3vvkl"]
atlas = ExtResource("2_02sxe")
region = Rect2(0, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_oacwj"]
atlas = ExtResource("2_02sxe")
region = Rect2(81, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_fu5g0"]
atlas = ExtResource("2_02sxe")
region = Rect2(162, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_1lf72"]
atlas = ExtResource("2_02sxe")
region = Rect2(243, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_j4aro"]
atlas = ExtResource("2_02sxe")
region = Rect2(324, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_26ege"]
atlas = ExtResource("2_02sxe")
region = Rect2(405, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_b54qx"]
atlas = ExtResource("2_02sxe")
region = Rect2(486, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_8dk34"]
atlas = ExtResource("3_ohyyq")
region = Rect2(0, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_h1v6f"]
atlas = ExtResource("3_ohyyq")
region = Rect2(81, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_48ieo"]
atlas = ExtResource("3_ohyyq")
region = Rect2(162, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_1ulxg"]
atlas = ExtResource("3_ohyyq")
region = Rect2(243, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_k2uqu"]
atlas = ExtResource("4_w1cra")
region = Rect2(0, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_s0lji"]
atlas = ExtResource("4_w1cra")
region = Rect2(81, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_g8aks"]
atlas = ExtResource("4_w1cra")
region = Rect2(162, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_xtf25"]
atlas = ExtResource("4_w1cra")
region = Rect2(243, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_6eob1"]
atlas = ExtResource("1_nr56x")
region = Rect2(0, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_v5p4t"]
atlas = ExtResource("1_nr56x")
region = Rect2(81, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_f6610"]
atlas = ExtResource("1_nr56x")
region = Rect2(162, 0, 81, 71)
[sub_resource type="AtlasTexture" id="AtlasTexture_yqejl"]
atlas = ExtResource("1_nr56x")
region = Rect2(243, 0, 81, 71)
[sub_resource type="SpriteFrames" id="SpriteFrames_02sxe"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_5rfnd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ig148")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nbb7h")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_20pyc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p746w")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3xtmj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_alngn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_eayuf")
}],
"loop": false,
"name": &"attack",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3vvkl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oacwj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fu5g0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1lf72")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j4aro")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_26ege")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b54qx")
}],
"loop": false,
"name": &"death",
"speed": 10.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_8dk34")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h1v6f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_48ieo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1ulxg")
}],
"loop": true,
"name": &"flying",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_k2uqu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s0lji")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_g8aks")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xtf25")
}],
"loop": false,
"name": &"hurt",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6eob1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v5p4t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f6610")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yqejl")
}],
"loop": true,
"name": &"idle",
"speed": 12.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ohyyq"]
radius = 41.0
height = 82.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yqejl"]
size = Vector2(513, 63)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_02sxe"]
size = Vector2(60, 50)
[node name="Demon" type="CharacterBody2D"]
texture_filter = 1
collision_layer = 2
collision_mask = 0
script = ExtResource("1_02sxe")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_02sxe")
animation = &"hurt"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-2, 2)
shape = SubResource("CapsuleShape2D_ohyyq")
debug_color = Color(0.49987894, 0.42888275, 1, 0.41960785)
[node name="DetectionArea" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionArea"]
position = Vector2(1.5, 0.5)
shape = SubResource("RectangleShape2D_yqejl")
debug_color = Color(0.3990774, 0.5954131, 0.3757497, 0.41960785)
[node name="AttackHitbox" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="AttackHitbox"]
shape = SubResource("RectangleShape2D_02sxe")
debug_color = Color(0.9642144, 0.14822191, 0.31210807, 0.41960785)