add enemy hitbox and refactor to characterBody2d

This commit is contained in:
2025-10-21 21:22:08 +01:00
parent 1fcc9a0a35
commit f9a218159c
7 changed files with 78 additions and 6 deletions

14
scenes/hit_box.tscn Normal file
View File

@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=3 uid="uid://bmv6eq8rt7fsb"]
[ext_resource type="Script" uid="uid://b3mc3t5k3yr7y" path="res://hit_box.gd" id="1_o631b"]
[ext_resource type="AudioStream" uid="uid://bhayvfhydadqy" path="res://assets/sounds/tap.wav" id="2_d7xod"]
[node name="HitBox" type="Area2D"]
collision_mask = 2
script = ExtResource("1_o631b")
[node name="HitSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("2_d7xod")
bus = &"SFX"
[connection signal="body_entered" from="." to="." method="_on_body_entered"]