Keycards and mapping

This commit is contained in:
MaddoScientisto 2025-03-19 22:00:03 +01:00
commit fbe8a52e06
20 changed files with 446 additions and 38 deletions

View file

@ -1,19 +1,54 @@
[gd_scene load_steps=5 format=3 uid="uid://byjq8xpx4crfd"]
[gd_scene load_steps=11 format=3 uid="uid://byjq8xpx4crfd"]
[ext_resource type="Script" uid="uid://duhodrhcnoslh" path="res://Scripts/Interactables/Switch.cs" id="1_qh7tc"]
[ext_resource type="Resource" uid="uid://cj5aa7btaw6q0" path="res://Resources/Items/Blue_Keycard.tres" id="2_0wao8"]
[ext_resource type="Texture2D" uid="uid://bc1383k5nnuyy" path="res://Sprites/Actors/Blue_Card_Reader.png" id="3_bdcur"]
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="2_k5c4k"]
[ext_resource type="Texture2D" uid="uid://c1hcyxn2og2kq" path="res://Sprites/Actors/Key_Reader.png" id="4_ma3tr"]
[ext_resource type="Texture2D" uid="uid://dsf7jj36mk0xp" path="res://Sprites/Actors/KeyReaderOverlay.png" id="5_mcwj3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vvpve"]
[sub_resource type="AtlasTexture" id="AtlasTexture_1r0vh"]
atlas = ExtResource("4_ma3tr")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_vnkqd"]
atlas = ExtResource("4_ma3tr")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_330vc"]
atlas = ExtResource("4_ma3tr")
region = Rect2(32, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_ck7ns"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1r0vh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vnkqd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_330vc")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="KeycardReaderBlue" type="Area2D" groups=["Interactable"]]
collision_layer = 4
collision_mask = 2
script = ExtResource("1_qh7tc")
Requirements = [ExtResource("2_0wao8")]
Requirements = Array[ExtResource("2_k5c4k")]([ExtResource("2_0wao8")])
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_vvpve")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("3_bdcur")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_ck7ns")
[node name="Sprite2D" type="Sprite2D" parent="AnimatedSprite2D"]
modulate = Color(0, 0.329412, 0.984314, 1)
texture = ExtResource("5_mcwj3")

View file

@ -1,19 +1,54 @@
[gd_scene load_steps=5 format=3 uid="uid://drdgcu2r3yrp7"]
[gd_scene load_steps=11 format=3 uid="uid://drdgcu2r3yrp7"]
[ext_resource type="Script" uid="uid://duhodrhcnoslh" path="res://Scripts/Interactables/Switch.cs" id="1_kb2ks"]
[ext_resource type="Resource" uid="uid://cspcgkr0tane2" path="res://Resources/Items/Green_Keycard.tres" id="2_kb2ks"]
[ext_resource type="Texture2D" uid="uid://cpaigf41fqxr5" path="res://Sprites/Actors/Green_Card_Reader.png" id="3_6ogyc"]
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="2_w8j5v"]
[ext_resource type="Texture2D" uid="uid://c1hcyxn2og2kq" path="res://Sprites/Actors/Key_Reader.png" id="4_3x3jg"]
[ext_resource type="Texture2D" uid="uid://dsf7jj36mk0xp" path="res://Sprites/Actors/KeyReaderOverlay.png" id="5_x0ajw"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vvpve"]
[sub_resource type="AtlasTexture" id="AtlasTexture_1r0vh"]
atlas = ExtResource("4_3x3jg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_vnkqd"]
atlas = ExtResource("4_3x3jg")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_330vc"]
atlas = ExtResource("4_3x3jg")
region = Rect2(32, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_ogukk"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1r0vh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vnkqd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_330vc")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="KeycardReaderGreen" type="Area2D" groups=["Interactable"]]
collision_layer = 4
collision_mask = 2
script = ExtResource("1_kb2ks")
Requirements = [ExtResource("2_kb2ks")]
Requirements = Array[ExtResource("2_w8j5v")]([ExtResource("2_kb2ks")])
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_vvpve")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("3_6ogyc")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_ogukk")
[node name="Sprite2D" type="Sprite2D" parent="AnimatedSprite2D"]
modulate = Color(0, 0.649225, 0.227165, 1)
texture = ExtResource("5_x0ajw")

View file

@ -1,20 +1,36 @@
[gd_scene load_steps=7 format=3 uid="uid://cdr4m7pydqk6u"]
[gd_scene load_steps=11 format=3 uid="uid://cdr4m7pydqk6u"]
[ext_resource type="Script" uid="uid://duhodrhcnoslh" path="res://Scripts/Interactables/Switch.cs" id="1_o8ph7"]
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="2_511l2"]
[ext_resource type="Resource" uid="uid://dibquna7fww7t" path="res://Resources/Items/Red_Keycard.tres" id="2_mv5hn"]
[ext_resource type="Texture2D" uid="uid://ch6nbhxgxxtf" path="res://Sprites/Red_Card_Reader.png" id="3_4xaqn"]
[ext_resource type="Texture2D" uid="uid://c1hcyxn2og2kq" path="res://Sprites/Actors/Key_Reader.png" id="4_im0oo"]
[ext_resource type="Texture2D" uid="uid://dsf7jj36mk0xp" path="res://Sprites/Actors/KeyReaderOverlay.png" id="5_k3f86"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vvpve"]
[sub_resource type="AtlasTexture" id="AtlasTexture_2vwlq"]
atlas = ExtResource("3_4xaqn")
region = Rect2(0, 0, 8, 8)
[sub_resource type="AtlasTexture" id="AtlasTexture_1r0vh"]
atlas = ExtResource("4_im0oo")
region = Rect2(0, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_jp3ap"]
[sub_resource type="AtlasTexture" id="AtlasTexture_vnkqd"]
atlas = ExtResource("4_im0oo")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_330vc"]
atlas = ExtResource("4_im0oo")
region = Rect2(32, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_3pfft"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_2vwlq")
"texture": SubResource("AtlasTexture_1r0vh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vnkqd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_330vc")
}],
"loop": true,
"name": &"default",
@ -25,11 +41,14 @@ animations = [{
collision_layer = 4
collision_mask = 2
script = ExtResource("1_o8ph7")
Requirements = [ExtResource("2_mv5hn")]
Requirements = Array[ExtResource("2_511l2")]([ExtResource("2_mv5hn")])
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_vvpve")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_jp3ap")
autoplay = "default"
[node name="AnimatedSprite2D2" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_3pfft")
[node name="Sprite2D" type="Sprite2D" parent="AnimatedSprite2D2"]
modulate = Color(0.988235, 0, 0.0588235, 1)
texture = ExtResource("5_k3f86")

View file

@ -0,0 +1,56 @@
[gd_scene load_steps=11 format=3 uid="uid://ue3i2qyhhtbg"]
[ext_resource type="Script" uid="uid://duhodrhcnoslh" path="res://Scripts/Interactables/Switch.cs" id="1_fef30"]
[ext_resource type="Resource" uid="uid://cspcgkr0tane2" path="res://Resources/Items/Green_Keycard.tres" id="2_05i2o"]
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="2_058fi"]
[ext_resource type="Texture2D" uid="uid://c1hcyxn2og2kq" path="res://Sprites/Actors/Key_Reader.png" id="4_al0cc"]
[ext_resource type="Texture2D" uid="uid://dsf7jj36mk0xp" path="res://Sprites/Actors/KeyReaderOverlay.png" id="5_co1pm"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vvpve"]
[sub_resource type="AtlasTexture" id="AtlasTexture_1r0vh"]
atlas = ExtResource("4_al0cc")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_vnkqd"]
atlas = ExtResource("4_al0cc")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_330vc"]
atlas = ExtResource("4_al0cc")
region = Rect2(32, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_ubfb0"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1r0vh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vnkqd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_330vc")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="KeycardReaderYellow" type="Area2D" groups=["Interactable"]]
collision_layer = 4
collision_mask = 2
script = ExtResource("1_fef30")
Requirements = Array[ExtResource("2_058fi")]([ExtResource("2_05i2o")])
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_vvpve")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_ubfb0")
frame = 2
frame_progress = 0.38043
[node name="Sprite2D" type="Sprite2D" parent="AnimatedSprite2D"]
modulate = Color(1, 0.882353, 0, 1)
texture = ExtResource("5_co1pm")