Alarm box

This commit is contained in:
Marco 2025-02-04 13:22:05 +01:00
commit 60dad2d002
15 changed files with 581 additions and 401 deletions

View file

@ -1,293 +1,49 @@
[gd_scene load_steps=38 format=3 uid="uid://c27co22bjym3c"]
[gd_scene load_steps=7 format=3 uid="uid://c27co22bjym3c"]
[ext_resource type="Script" path="res://Scripts/Actors/Camera.cs" id="1_2qb38"]
[ext_resource type="Texture2D" uid="uid://cpuffmksk41n4" path="res://Sprites/Actors/Camera.png" id="1_l5lfg"]
[sub_resource type="AtlasTexture" id="AtlasTexture_1cxu1"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_bi4kn"]
atlas = ExtResource("1_l5lfg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_qgntu"]
atlas = ExtResource("1_l5lfg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_0xn7d"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_5xbm6"]
atlas = ExtResource("1_l5lfg")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_oxghg"]
atlas = ExtResource("1_l5lfg")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_6e5gf"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_dxl8p"]
atlas = ExtResource("1_l5lfg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_d0i3t"]
atlas = ExtResource("1_l5lfg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_oy0eq"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_14w2k"]
atlas = ExtResource("1_l5lfg")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_m2si1"]
atlas = ExtResource("1_l5lfg")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_lbhml"]
atlas = ExtResource("1_l5lfg")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_rw7h1"]
atlas = ExtResource("1_l5lfg")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_x62ns"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_unrcw"]
atlas = ExtResource("1_l5lfg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_y5qth"]
atlas = ExtResource("1_l5lfg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_qkmcw"]
atlas = ExtResource("1_l5lfg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_myuwn"]
atlas = ExtResource("1_l5lfg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_8aa11"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_u7xyi"]
atlas = ExtResource("1_l5lfg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_qrkj0"]
atlas = ExtResource("1_l5lfg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_qcqm5"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_34faw"]
atlas = ExtResource("1_l5lfg")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_j34h0"]
atlas = ExtResource("1_l5lfg")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ojvts"]
atlas = ExtResource("1_l5lfg")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_kf402"]
atlas = ExtResource("1_l5lfg")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_aaebm"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_owve1"]
atlas = ExtResource("1_l5lfg")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_0eww4"]
atlas = ExtResource("1_l5lfg")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_0pie4"]
atlas = ExtResource("1_l5lfg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_oh7bx"]
atlas = ExtResource("1_l5lfg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_vxoib"]
atlas = ExtResource("1_l5lfg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_dvf56"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1cxu1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bi4kn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qgntu")
}],
"loop": false,
"name": &"center_to_left",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_0xn7d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5xbm6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oxghg")
}],
"loop": false,
"name": &"center_to_right",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6e5gf")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_dxl8p")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d0i3t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oy0eq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_14w2k")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m2si1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lbhml")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rw7h1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x62ns")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_unrcw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_y5qth")
}],
"loop": true,
"name": &"full_scan",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_qkmcw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_myuwn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8aa11")
}],
"loop": false,
"name": &"left_to_center",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_u7xyi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qrkj0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qcqm5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_34faw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j34h0")
}],
"loop": false,
"name": &"left_to_right",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ojvts")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kf402")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_aaebm")
}],
"loop": false,
"name": &"right_to_center",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_owve1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0eww4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0pie4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oh7bx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vxoib")
}],
"loop": false,
"name": &"right_to_left",
"speed": 5.0
}]
[ext_resource type="SpriteFrames" uid="uid://yfxog8pww6ih" path="res://Resources/Sprites/Camera.tres" id="2_omkb8"]
[ext_resource type="Script" path="res://Scripts/Components/ProximityPlayerDetection.cs" id="3_1qxk5"]
[sub_resource type="CircleShape2D" id="CircleShape2D_nkpag"]
[node name="Camera" type="Area2D"]
[sub_resource type="CircleShape2D" id="CircleShape2D_gs7jc"]
radius = 85.0529
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3bqsq"]
size = Vector2(8, 12)
[node name="Camera" type="CharacterBody2D" node_paths=PackedStringArray("_playerDetection")]
collision_layer = 16
collision_mask = 8
script = ExtResource("1_2qb38")
Health = 1.0
WalkSpeed = 0.0
_playerDetection = NodePath("PlayerDetection")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_dvf56")
sprite_frames = ExtResource("2_omkb8")
animation = &"full_scan"
frame_progress = 0.779565
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_nkpag")
[node name="PlayerDetection" type="Area2D" parent="."]
visible = false
collision_layer = 16
collision_mask = 2
script = ExtResource("3_1qxk5")
[node name="PlayerDetectionArea" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_gs7jc")
[node name="DamageHitbox" type="Area2D" parent="."]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageHitbox"]
shape = SubResource("RectangleShape2D_3bqsq")
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
[connection signal="area_entered" from="DamageHitbox" to="." method="_on_damage_hitbox_area_entered"]

View file

@ -22,12 +22,13 @@ radius = 85.0529
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m1rsg"]
size = Vector2(8, 12)
[node name="Enemy" type="CharacterBody2D" node_paths=PackedStringArray("EquippedWeapon") groups=["Destroyable"]]
[node name="Enemy" type="CharacterBody2D" node_paths=PackedStringArray("EquippedWeapon", "_playerDetection") groups=["Destroyable"]]
collision_layer = 16
collision_mask = 9
script = ExtResource("1_h0ey4")
EquippedWeapon = NodePath("Weapon")
NavigationEnabled = true
_playerDetection = NodePath("PlayerDetection")
_navigationEnabled = true
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]