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
This commit is contained in:
doctorbatmanwho-creator committed 2026-06-18 20:27:14 -04:00
1 parent f0d3931c37
commit 13f95562a7
7 files changed
+90 -14

No files matched your search

+1 -2
View File
@@ -242,8 +242,7 @@ script = ExtResource("1_02sxe")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_02sxe")
animation = &"flying"
frame_progress = 0.13023382
animation = &"hurt"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-2, 2)
+5 -1
View File
@@ -693,14 +693,18 @@ animations = [{
[node name="CharacterBody2D" type="CharacterBody2D"]
z_index = 10
position = Vector2(2, -1)
collision_mask = 3
script = ExtResource("1_0y7nr")
metadata/_edit_group_ = true
[node name="PunchHitbox" type="Area2D" parent="."]
visibility_layer = 2
position = Vector2(50.5, -5)
collision_layer = 4
collision_mask = 2
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)
+2
View File
@@ -368,6 +368,7 @@ size = Vector2(452, 33)
[node name="Skeleton" type="CharacterBody2D"]
z_index = 10
collision_layer = 2
script = ExtResource("1_abfcy")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
@@ -390,6 +391,7 @@ shape = SubResource("RectangleShape2D_yek4v")
debug_color = Color(0.51556015, 0.56157154, 0.37343058, 0.41960785)
[node name="AttackHitbox" type="Area2D" parent="."]
collision_layer = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="AttackHitbox"]
position = Vector2(37, 0.5)
+2 -2
View File
@@ -2,7 +2,7 @@
[ext_resource type="PackedScene" uid="uid://bu8e4iyw8pc03" path="res://Scenes/Characters/Player.tscn" id="1_d5ayw"]
[ext_resource type="Script" uid="uid://bs4frobn6kxne" path="res://Scripts/scene_manager.gd" id="2_us1pb"]
[ext_resource type="PackedScene" uid="uid://bcray1583u4e6" path="res://Scenes/Levels/Level_2_demons.tscn" id="3_d5ayw"]
[ext_resource type="PackedScene" uid="uid://8n6472fqqmcc" path="res://Scenes/Levels/Level_3_graveyard.tscn" id="3_d5ayw"]
[node name="MainGame" type="Node2D"]
@@ -13,4 +13,4 @@ script = ExtResource("2_us1pb")
[node name="CurrentLevel" type="Node2D" parent="."]
[node name="DemonRace" parent="CurrentLevel" instance=ExtResource("3_d5ayw")]
[node name="Graveyard" parent="CurrentLevel" instance=ExtResource("3_d5ayw")]