Compare commits
6 Commits
353efc100f
...
e4ecae376e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4ecae376e | ||
|
|
9b91e78c20 | ||
|
|
8773ecfa6a | ||
|
|
c1f742ae61 | ||
|
|
e14303da9b | ||
|
|
5f33e16165 |
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=13 format=3 uid="uid://cozypaw_main"]
|
[gd_scene load_steps=17 format=3 uid="uid://cozypaw_main"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/main/main.gd" id="1_main"]
|
[ext_resource type="Script" path="res://scripts/main/main.gd" id="1_main"]
|
||||||
[ext_resource type="PackedScene" path="res://scenes/rooms/floor0/Reception.tscn" id="2_reception"]
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor0/Reception.tscn" id="2_reception"]
|
||||||
@@ -11,6 +11,10 @@
|
|||||||
[ext_resource type="PackedScene" path="res://scenes/rooms/floor0/Restaurant.tscn" id="9_restaurant"]
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor0/Restaurant.tscn" id="9_restaurant"]
|
||||||
[ext_resource type="PackedScene" path="res://scenes/rooms/floor0/EmergencyRoom.tscn" id="10_emergency"]
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor0/EmergencyRoom.tscn" id="10_emergency"]
|
||||||
[ext_resource type="PackedScene" path="res://scenes/objects/NavigationArrow.tscn" id="11_navarrow"]
|
[ext_resource type="PackedScene" path="res://scenes/objects/NavigationArrow.tscn" id="11_navarrow"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor1/XRay.tscn" id="12_xray"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor1/Pharmacy.tscn" id="13_pharmacy"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor1/Lab.tscn" id="14_lab"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/rooms/floor1/PatientRoom.tscn" id="15_patientroom"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="CharacterData_bunny1"]
|
[sub_resource type="Resource" id="CharacterData_bunny1"]
|
||||||
script = ExtResource("7_chardata")
|
script = ExtResource("7_chardata")
|
||||||
@@ -88,32 +92,62 @@ label_text = "←"
|
|||||||
[node name="Floor1" type="Node2D" parent="Hospital"]
|
[node name="Floor1" type="Node2D" parent="Hospital"]
|
||||||
position = Vector2(0, -720)
|
position = Vector2(0, -720)
|
||||||
|
|
||||||
[node name="Background" type="ColorRect" parent="Hospital/Floor1"]
|
[node name="XRay" parent="Hospital/Floor1" instance=ExtResource("12_xray")]
|
||||||
color = Color(0.78, 0.88, 0.96, 1)
|
|
||||||
size = Vector2(1280, 720)
|
|
||||||
position = Vector2(0, 0)
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
[node name="FloorLabel" type="Label" parent="Hospital/Floor1"]
|
[node name="Pharmacy" parent="Hospital/Floor1" instance=ExtResource("13_pharmacy")]
|
||||||
offset_left = 560.0
|
position = Vector2(1280, 0)
|
||||||
offset_top = 300.0
|
|
||||||
offset_right = 720.0
|
|
||||||
offset_bottom = 360.0
|
|
||||||
text = "1. OG"
|
|
||||||
theme_override_font_sizes/font_size = 32
|
|
||||||
|
|
||||||
[node name="FloorRect" type="ColorRect" parent="Hospital/Floor1"]
|
[node name="Lab" parent="Hospital/Floor1" instance=ExtResource("14_lab")]
|
||||||
color = Color(0.88, 0.80, 0.68, 1)
|
position = Vector2(2560, 0)
|
||||||
size = Vector2(1280, 100)
|
|
||||||
position = Vector2(0, 620)
|
[node name="PatientRoom" parent="Hospital/Floor1" instance=ExtResource("15_patientroom")]
|
||||||
|
position = Vector2(3840, 0)
|
||||||
|
|
||||||
[node name="ElevatorDown1" parent="Hospital/Floor1" instance=ExtResource("6_elevbtn")]
|
[node name="ElevatorDown1" parent="Hospital/Floor1" instance=ExtResource("6_elevbtn")]
|
||||||
position = Vector2(1200, 540)
|
position = Vector2(1100, 540)
|
||||||
target_floor = 0
|
target_floor = 0
|
||||||
|
|
||||||
[node name="ElevatorUp1" parent="Hospital/Floor1" instance=ExtResource("6_elevbtn")]
|
[node name="ElevatorUp1" parent="Hospital/Floor1" instance=ExtResource("6_elevbtn")]
|
||||||
position = Vector2(1200, 180)
|
position = Vector2(1100, 180)
|
||||||
target_floor = 2
|
target_floor = 2
|
||||||
|
|
||||||
|
[node name="NavRight0to1_F1" parent="Hospital/Floor1" instance=ExtResource("11_navarrow")]
|
||||||
|
position = Vector2(1200, 480)
|
||||||
|
target_floor = 1
|
||||||
|
target_room = 1
|
||||||
|
label_text = "→"
|
||||||
|
|
||||||
|
[node name="NavLeft1to0_F1" parent="Hospital/Floor1" instance=ExtResource("11_navarrow")]
|
||||||
|
position = Vector2(1340, 480)
|
||||||
|
target_floor = 1
|
||||||
|
target_room = 0
|
||||||
|
label_text = "←"
|
||||||
|
|
||||||
|
[node name="NavRight1to2_F1" parent="Hospital/Floor1" instance=ExtResource("11_navarrow")]
|
||||||
|
position = Vector2(2480, 480)
|
||||||
|
target_floor = 1
|
||||||
|
target_room = 2
|
||||||
|
label_text = "→"
|
||||||
|
|
||||||
|
[node name="NavLeft2to1_F1" parent="Hospital/Floor1" instance=ExtResource("11_navarrow")]
|
||||||
|
position = Vector2(2600, 480)
|
||||||
|
target_floor = 1
|
||||||
|
target_room = 1
|
||||||
|
label_text = "←"
|
||||||
|
|
||||||
|
[node name="NavRight2to3_F1" parent="Hospital/Floor1" instance=ExtResource("11_navarrow")]
|
||||||
|
position = Vector2(3760, 480)
|
||||||
|
target_floor = 1
|
||||||
|
target_room = 3
|
||||||
|
label_text = "→"
|
||||||
|
|
||||||
|
[node name="NavLeft3to2_F1" parent="Hospital/Floor1" instance=ExtResource("11_navarrow")]
|
||||||
|
position = Vector2(3920, 480)
|
||||||
|
target_floor = 1
|
||||||
|
target_room = 2
|
||||||
|
label_text = "←"
|
||||||
|
|
||||||
[node name="Floor2" type="Node2D" parent="Hospital"]
|
[node name="Floor2" type="Node2D" parent="Hospital"]
|
||||||
position = Vector2(0, -1440)
|
position = Vector2(0, -1440)
|
||||||
|
|
||||||
|
|||||||
34
scenes/objects/XRayMachine.tscn
Normal file
34
scenes/objects/XRayMachine.tscn
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cozypaw_xraymachine"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/objects/xray_machine.gd" id="1_xraymachine"]
|
||||||
|
|
||||||
|
[node name="XRayMachine" type="Node2D"]
|
||||||
|
script = ExtResource("1_xraymachine")
|
||||||
|
|
||||||
|
[node name="MachineBody" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.68, 0.70, 0.76, 1)
|
||||||
|
size = Vector2(80, 200)
|
||||||
|
position = Vector2(-40, -200)
|
||||||
|
|
||||||
|
[node name="MachineArm" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.62, 0.64, 0.70, 1)
|
||||||
|
size = Vector2(220, 24)
|
||||||
|
position = Vector2(-40, -180)
|
||||||
|
|
||||||
|
[node name="ViewerFrame" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.20, 0.22, 0.26, 1)
|
||||||
|
size = Vector2(80, 60)
|
||||||
|
position = Vector2(-40, -195)
|
||||||
|
|
||||||
|
[node name="Viewer" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.06, 0.08, 0.12, 1)
|
||||||
|
size = Vector2(66, 46)
|
||||||
|
position = Vector2(-33, -189)
|
||||||
|
|
||||||
|
[node name="Plate" type="Node2D" parent="."]
|
||||||
|
position = Vector2(-50, 20)
|
||||||
|
|
||||||
|
[node name="PlateBody" type="ColorRect" parent="Plate"]
|
||||||
|
color = Color(0.28, 0.32, 0.38, 1)
|
||||||
|
size = Vector2(200, 14)
|
||||||
|
position = Vector2(0, -7)
|
||||||
70
scenes/rooms/floor1/Lab.tscn
Normal file
70
scenes/rooms/floor1/Lab.tscn
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cozypaw_lab"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
|
||||||
|
|
||||||
|
[node name="Lab" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Background" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.90, 0.94, 0.96, 1)
|
||||||
|
size = Vector2(1280, 720)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="Floor" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.78, 0.82, 0.86, 1)
|
||||||
|
size = Vector2(1280, 100)
|
||||||
|
position = Vector2(0, 620)
|
||||||
|
|
||||||
|
[node name="WallLeft" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.92, 0.94, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="WallRight" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.92, 0.94, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(1240, 0)
|
||||||
|
|
||||||
|
[node name="LabBench" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.88, 0.92, 1)
|
||||||
|
size = Vector2(800, 40)
|
||||||
|
position = Vector2(240, 480)
|
||||||
|
|
||||||
|
[node name="LabBenchFront" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.72, 0.78, 1)
|
||||||
|
size = Vector2(800, 16)
|
||||||
|
position = Vector2(240, 520)
|
||||||
|
|
||||||
|
[node name="LabBenchLegLeft" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.72, 0.78, 1)
|
||||||
|
size = Vector2(16, 140)
|
||||||
|
position = Vector2(260, 536)
|
||||||
|
|
||||||
|
[node name="LabBenchLegRight" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.72, 0.78, 1)
|
||||||
|
size = Vector2(16, 140)
|
||||||
|
position = Vector2(1008, 536)
|
||||||
|
|
||||||
|
[node name="Sink" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.75, 0.80, 0.84, 1)
|
||||||
|
size = Vector2(100, 50)
|
||||||
|
position = Vector2(1060, 430)
|
||||||
|
|
||||||
|
[node name="SinkBase" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.60, 0.64, 0.68, 1)
|
||||||
|
size = Vector2(100, 190)
|
||||||
|
position = Vector2(1060, 480)
|
||||||
|
|
||||||
|
[node name="CharacterSpawn" type="Marker2D" parent="."]
|
||||||
|
position = Vector2(200, 490)
|
||||||
|
|
||||||
|
[node name="Microscope" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(380, 450)
|
||||||
|
|
||||||
|
[node name="TestTubeRack" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(600, 450)
|
||||||
|
|
||||||
|
[node name="ReagentBottle" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(820, 450)
|
||||||
|
|
||||||
|
[node name="PetriDish" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(490, 450)
|
||||||
84
scenes/rooms/floor1/PatientRoom.tscn
Normal file
84
scenes/rooms/floor1/PatientRoom.tscn
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cozypaw_patientroom"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
|
||||||
|
|
||||||
|
[node name="PatientRoom" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Background" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.96, 0.94, 0.88, 1)
|
||||||
|
size = Vector2(1280, 720)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="Floor" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.82, 0.72, 1)
|
||||||
|
size = Vector2(1280, 100)
|
||||||
|
position = Vector2(0, 620)
|
||||||
|
|
||||||
|
[node name="WallLeft" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.94, 0.92, 0.86, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="WallRight" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.94, 0.92, 0.86, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(1240, 0)
|
||||||
|
|
||||||
|
[node name="Bed1Frame" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.85, 0.85, 0.90, 1)
|
||||||
|
size = Vector2(260, 50)
|
||||||
|
position = Vector2(120, 490)
|
||||||
|
|
||||||
|
[node name="Bed1Pillow" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.96, 0.96, 1.0, 1)
|
||||||
|
size = Vector2(80, 50)
|
||||||
|
position = Vector2(120, 440)
|
||||||
|
|
||||||
|
[node name="Bed1Leg1" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.70, 0.76, 1)
|
||||||
|
size = Vector2(14, 130)
|
||||||
|
position = Vector2(136, 540)
|
||||||
|
|
||||||
|
[node name="Bed1Leg2" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.70, 0.76, 1)
|
||||||
|
size = Vector2(14, 130)
|
||||||
|
position = Vector2(350, 540)
|
||||||
|
|
||||||
|
[node name="Bed2Frame" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.85, 0.85, 0.90, 1)
|
||||||
|
size = Vector2(260, 50)
|
||||||
|
position = Vector2(680, 490)
|
||||||
|
|
||||||
|
[node name="Bed2Pillow" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.96, 0.96, 1.0, 1)
|
||||||
|
size = Vector2(80, 50)
|
||||||
|
position = Vector2(680, 440)
|
||||||
|
|
||||||
|
[node name="Bed2Leg1" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.70, 0.76, 1)
|
||||||
|
size = Vector2(14, 130)
|
||||||
|
position = Vector2(696, 540)
|
||||||
|
|
||||||
|
[node name="Bed2Leg2" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.70, 0.70, 0.76, 1)
|
||||||
|
size = Vector2(14, 130)
|
||||||
|
position = Vector2(910, 540)
|
||||||
|
|
||||||
|
[node name="TVFrame" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.18, 0.18, 0.20, 1)
|
||||||
|
size = Vector2(200, 130)
|
||||||
|
position = Vector2(1000, 200)
|
||||||
|
|
||||||
|
[node name="TVScreen" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.08, 0.10, 0.14, 1)
|
||||||
|
size = Vector2(184, 114)
|
||||||
|
position = Vector2(1008, 208)
|
||||||
|
|
||||||
|
[node name="CharacterSpawn" type="Marker2D" parent="."]
|
||||||
|
position = Vector2(480, 490)
|
||||||
|
|
||||||
|
[node name="TV" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(1100, 265)
|
||||||
|
|
||||||
|
[node name="BedsideTable" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(500, 540)
|
||||||
70
scenes/rooms/floor1/Pharmacy.tscn
Normal file
70
scenes/rooms/floor1/Pharmacy.tscn
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cozypaw_pharmacy"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
|
||||||
|
|
||||||
|
[node name="Pharmacy" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Background" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.96, 0.94, 0.82, 1)
|
||||||
|
size = Vector2(1280, 720)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="Floor" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.80, 0.68, 1)
|
||||||
|
size = Vector2(1280, 100)
|
||||||
|
position = Vector2(0, 620)
|
||||||
|
|
||||||
|
[node name="WallLeft" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.96, 0.94, 0.86, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="WallRight" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.96, 0.94, 0.86, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(1240, 0)
|
||||||
|
|
||||||
|
[node name="MedicineShelf" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.75, 0.55, 0.30, 1)
|
||||||
|
size = Vector2(700, 20)
|
||||||
|
position = Vector2(290, 300)
|
||||||
|
|
||||||
|
[node name="MedicineShelfLegLeft" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.62, 0.44, 0.22, 1)
|
||||||
|
size = Vector2(16, 320)
|
||||||
|
position = Vector2(290, 300)
|
||||||
|
|
||||||
|
[node name="MedicineShelfLegRight" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.62, 0.44, 0.22, 1)
|
||||||
|
size = Vector2(16, 320)
|
||||||
|
position = Vector2(974, 300)
|
||||||
|
|
||||||
|
[node name="MedicineShelf2" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.75, 0.55, 0.30, 1)
|
||||||
|
size = Vector2(700, 20)
|
||||||
|
position = Vector2(290, 460)
|
||||||
|
|
||||||
|
[node name="Counter" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.62, 0.44, 0.22, 1)
|
||||||
|
size = Vector2(300, 80)
|
||||||
|
position = Vector2(490, 540)
|
||||||
|
|
||||||
|
[node name="CounterTop" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.78, 0.62, 0.36, 1)
|
||||||
|
size = Vector2(300, 12)
|
||||||
|
position = Vector2(490, 528)
|
||||||
|
|
||||||
|
[node name="CharacterSpawn" type="Marker2D" parent="."]
|
||||||
|
position = Vector2(200, 520)
|
||||||
|
|
||||||
|
[node name="VitaminBottle" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(380, 270)
|
||||||
|
|
||||||
|
[node name="BandageRoll" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(640, 270)
|
||||||
|
|
||||||
|
[node name="SyrupBottle" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(900, 270)
|
||||||
|
|
||||||
|
[node name="MedicineBox" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(640, 430)
|
||||||
55
scenes/rooms/floor1/XRay.tscn
Normal file
55
scenes/rooms/floor1/XRay.tscn
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://cozypaw_xray"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/objects/XRayMachine.tscn" id="2_xraymachine"]
|
||||||
|
|
||||||
|
[node name="XRay" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Background" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.92, 0.96, 1)
|
||||||
|
size = Vector2(1280, 720)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="Floor" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.78, 0.80, 0.86, 1)
|
||||||
|
size = Vector2(1280, 100)
|
||||||
|
position = Vector2(0, 620)
|
||||||
|
|
||||||
|
[node name="WallLeft" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.90, 0.94, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(0, 0)
|
||||||
|
|
||||||
|
[node name="WallRight" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.88, 0.90, 0.94, 1)
|
||||||
|
size = Vector2(40, 620)
|
||||||
|
position = Vector2(1240, 0)
|
||||||
|
|
||||||
|
[node name="ExamTable" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.84, 0.86, 0.90, 1)
|
||||||
|
size = Vector2(320, 40)
|
||||||
|
position = Vector2(480, 490)
|
||||||
|
|
||||||
|
[node name="ExamTableLeg1" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.65, 0.68, 0.74, 1)
|
||||||
|
size = Vector2(16, 130)
|
||||||
|
position = Vector2(500, 530)
|
||||||
|
|
||||||
|
[node name="ExamTableLeg2" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.65, 0.68, 0.74, 1)
|
||||||
|
size = Vector2(16, 130)
|
||||||
|
position = Vector2(768, 530)
|
||||||
|
|
||||||
|
[node name="LeadApron" type="ColorRect" parent="."]
|
||||||
|
color = Color(0.30, 0.40, 0.35, 1)
|
||||||
|
size = Vector2(60, 120)
|
||||||
|
position = Vector2(1100, 480)
|
||||||
|
|
||||||
|
[node name="CharacterSpawn" type="Marker2D" parent="."]
|
||||||
|
position = Vector2(200, 490)
|
||||||
|
|
||||||
|
[node name="XRayMachine" parent="." instance=ExtResource("2_xraymachine")]
|
||||||
|
position = Vector2(500, 510)
|
||||||
|
|
||||||
|
[node name="PlasterStation" parent="." instance=ExtResource("1_iobj")]
|
||||||
|
position = Vector2(900, 560)
|
||||||
76
scripts/objects/xray_machine.gd
Normal file
76
scripts/objects/xray_machine.gd
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
## XRayMachine — X-ray plate slides out when tapped; viewer lights up during exposure.
|
||||||
|
class_name XRayMachine extends Node2D
|
||||||
|
|
||||||
|
enum State { IDLE, SLIDING_IN, EXPOSING, SLIDING_OUT }
|
||||||
|
|
||||||
|
const SLIDE_DURATION: float = 0.8
|
||||||
|
const EXPOSE_DURATION: float = 1.5
|
||||||
|
const BUTTON_HALF_WIDTH: float = 50.0
|
||||||
|
const BUTTON_HALF_HEIGHT: float = 100.0
|
||||||
|
const PLATE_PARKED_X: float = -50.0
|
||||||
|
const PLATE_ACTIVE_X: float = 130.0
|
||||||
|
const VIEWER_LIT_COLOR: Color = Color(0.75, 0.90, 1.0, 1)
|
||||||
|
const VIEWER_DARK_COLOR: Color = Color(0.06, 0.08, 0.12, 1)
|
||||||
|
|
||||||
|
var _state: State = State.IDLE
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
var plate: Node2D = get_node_or_null("Plate") as Node2D
|
||||||
|
if plate != null:
|
||||||
|
plate.position.x = PLATE_PARKED_X
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void:
|
||||||
|
if _state != State.IDLE:
|
||||||
|
return
|
||||||
|
var screen_pos: Vector2
|
||||||
|
if event is InputEventScreenTouch and event.pressed:
|
||||||
|
screen_pos = event.position
|
||||||
|
elif event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
||||||
|
screen_pos = event.position
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
var canvas_transform: Transform2D = get_viewport().get_canvas_transform()
|
||||||
|
var world_pos: Vector2 = canvas_transform.affine_inverse() * screen_pos
|
||||||
|
var local_pos: Vector2 = to_local(world_pos)
|
||||||
|
if abs(local_pos.x) <= BUTTON_HALF_WIDTH and abs(local_pos.y) <= BUTTON_HALF_HEIGHT:
|
||||||
|
_start_scan()
|
||||||
|
|
||||||
|
|
||||||
|
func _start_scan() -> void:
|
||||||
|
_state = State.SLIDING_IN
|
||||||
|
var plate: Node2D = get_node_or_null("Plate") as Node2D
|
||||||
|
if plate == null:
|
||||||
|
_state = State.IDLE
|
||||||
|
return
|
||||||
|
var tween: Tween = create_tween()
|
||||||
|
tween.set_ease(Tween.EASE_IN_OUT)
|
||||||
|
tween.set_trans(Tween.TRANS_QUAD)
|
||||||
|
tween.tween_property(plate, "position:x", PLATE_ACTIVE_X, SLIDE_DURATION)
|
||||||
|
tween.finished.connect(_on_plate_in)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_plate_in() -> void:
|
||||||
|
_state = State.EXPOSING
|
||||||
|
var viewer: ColorRect = get_node_or_null("Viewer") as ColorRect
|
||||||
|
if viewer != null:
|
||||||
|
viewer.color = VIEWER_LIT_COLOR
|
||||||
|
var timer: SceneTreeTimer = get_tree().create_timer(EXPOSE_DURATION)
|
||||||
|
timer.timeout.connect(_start_slide_out)
|
||||||
|
|
||||||
|
|
||||||
|
func _start_slide_out() -> void:
|
||||||
|
_state = State.SLIDING_OUT
|
||||||
|
var viewer: ColorRect = get_node_or_null("Viewer") as ColorRect
|
||||||
|
if viewer != null:
|
||||||
|
viewer.color = VIEWER_DARK_COLOR
|
||||||
|
var plate: Node2D = get_node_or_null("Plate") as Node2D
|
||||||
|
if plate == null:
|
||||||
|
_state = State.IDLE
|
||||||
|
return
|
||||||
|
var tween: Tween = create_tween()
|
||||||
|
tween.set_ease(Tween.EASE_IN_OUT)
|
||||||
|
tween.set_trans(Tween.TRANS_QUAD)
|
||||||
|
tween.tween_property(plate, "position:x", PLATE_PARKED_X, SLIDE_DURATION)
|
||||||
|
tween.finished.connect(func() -> void: _state = State.IDLE)
|
||||||
Reference in New Issue
Block a user