feat: add area2d; connect a bodyEntered and bodyLeft signals to that area2d;

This commit is contained in:
2026-08-18 14:02:19 +02:00
parent ee8c8837d3
commit 4638954cdc
4 changed files with 45 additions and 9 deletions
+8 -8
View File
@@ -3,10 +3,6 @@
[ext_resource type="Script" uid="uid://duilaa5lwqeup" path="res://Scenes/Player/player.gd" id="1_a3d8c"]
[ext_resource type="Texture2D" uid="uid://cjbvc07lh4x1b" path="res://Ninja Adventure - Asset Pack/Actor/Characters/KnightGold/SeparateAnim/Walk.png" id="2_a3d8c"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bqpwv"]
radius = 5.0
height = 10.0
[sub_resource type="AtlasTexture" id="AtlasTexture_a3d8c"]
atlas = ExtResource("2_a3d8c")
region = Rect2(0, 0, 16, 16)
@@ -142,14 +138,18 @@ animations = [{
"speed": 6.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bqpwv"]
radius = 5.0
height = 10.0
[node name="CharacterBody2D" type="CharacterBody2D" unique_id=1991398375]
motion_mode = 1
script = ExtResource("1_a3d8c")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=129222135]
position = Vector2(0, 3)
shape = SubResource("CapsuleShape2D_bqpwv")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=721334358]
sprite_frames = SubResource("SpriteFrames_bqpwv")
animation = &"move_down"
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=129222135]
position = Vector2(0, 3)
shape = SubResource("CapsuleShape2D_bqpwv")