diff --git a/.gitignore b/.gitignore index 7c1510c..24b84c3 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ mono_crash.*.json # ignore potentially large filetypes *.csv *.obj -*.ogg \ No newline at end of file +*.ogg +*.png +*.jpg diff --git a/default_env.tres b/default_env.tres index 20207a4..605c703 100644 --- a/default_env.tres +++ b/default_env.tres @@ -5,3 +5,4 @@ [resource] background_mode = 2 background_sky = SubResource( 1 ) +ss_reflections_enabled = true diff --git a/fonts/TitilliumWeb/OFL.txt b/fonts/TitilliumWeb/OFL.txt new file mode 100644 index 0000000..bbaa23a --- /dev/null +++ b/fonts/TitilliumWeb/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2009-2011 by Accademia di Belle Arti di Urbino and students of MA course of Visual design. Some rights reserved. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/TitilliumWeb/TitilliumWeb-Bold.ttf b/fonts/TitilliumWeb/TitilliumWeb-Bold.ttf new file mode 100644 index 0000000..b3d8c34 Binary files /dev/null and b/fonts/TitilliumWeb/TitilliumWeb-Bold.ttf differ diff --git a/fonts/TitilliumWeb/TitilliumWeb-Regular.ttf b/fonts/TitilliumWeb/TitilliumWeb-Regular.ttf new file mode 100644 index 0000000..e0e2dc8 Binary files /dev/null and b/fonts/TitilliumWeb/TitilliumWeb-Regular.ttf differ diff --git a/project.godot b/project.godot index da609a6..69ef670 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,11 @@ config_version=4 [application] config/name="VoxelTest" -run/main_scene="res://scenes/Main.tscn" +run/main_scene="res://scenes/MainMenu.tscn" + +[autoload] + +Global="*res://scripts/Global.gd" [gui] @@ -69,6 +73,21 @@ toggle_debug={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":86,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } +sprint={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +esc={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +interact={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":70,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} [physics] diff --git a/scenes/GeigerCounter.tscn b/scenes/GeigerCounter.tscn index 09f62bb..e11d44b 100644 --- a/scenes/GeigerCounter.tscn +++ b/scenes/GeigerCounter.tscn @@ -1,88 +1,123 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=26 format=2] -[ext_resource path="res://scripts/GeigerViewport.gd" type="Script" id=1] -[ext_resource path="res://fonts/Montserrat-Medium.ttf" type="DynamicFontData" id=2] [ext_resource path="res://fonts/Cutive_Mono/CutiveMono-Regular.ttf" type="DynamicFontData" id=3] [ext_resource path="res://geigercounter.ogg" type="AudioStream" id=4] [ext_resource path="res://scripts/ClickSound.gd" type="Script" id=5] +[ext_resource path="res://textures/SoundButton.png" type="Texture" id=6] +[ext_resource path="res://textures/PowerButton.png" type="Texture" id=7] +[ext_resource path="res://models/GeigerCounter.obj" type="ArrayMesh" id=8] +[ext_resource path="res://textures/UnitButton.png" type="Texture" id=9] +[ext_resource path="res://textures/SoundWaves.png" type="Texture" id=10] +[ext_resource path="res://textures/SoundIcon.png" type="Texture" id=11] +[ext_resource path="res://textures/BatteryIcon.png" type="Texture" id=12] -[sub_resource type="CubeMesh" id=1] -size = Vector3( 1, 1, 1 ) +[sub_resource type="SpatialMaterial" id=12] +albedo_color = Color( 0.145098, 0.145098, 0.145098, 1 ) + +[sub_resource type="SpatialMaterial" id=19] +flags_transparent = true +albedo_color = Color( 0.427451, 0.427451, 0.427451, 0.352941 ) + +[sub_resource type="SpatialMaterial" id=14] +albedo_color = Color( 0.709804, 0.0666667, 0.0666667, 1 ) + +[sub_resource type="SpatialMaterial" id=15] + +[sub_resource type="SpatialMaterial" id=20] +albedo_color = Color( 0.364706, 0.364706, 0.364706, 1 ) -[sub_resource type="SpatialMaterial" id=2] -albedo_color = Color( 0.0156863, 0.160784, 0.501961, 1 ) +[sub_resource type="SpatialMaterial" id=21] +albedo_texture = ExtResource( 7 ) +uv1_scale = Vector3( 1.992, -1.974, 1 ) -[sub_resource type="CubeMesh" id=3] +[sub_resource type="SpatialMaterial" id=22] +albedo_texture = ExtResource( 6 ) +uv1_scale = Vector3( 2, 2, 1 ) + +[sub_resource type="SpatialMaterial" id=23] +albedo_texture = ExtResource( 9 ) +uv1_scale = Vector3( 2, -2, 1 ) + +[sub_resource type="SpatialMaterial" id=18] +albedo_color = Color( 0.0705882, 0.0705882, 0.0705882, 1 ) + +[sub_resource type="CubeMesh" id=24] size = Vector3( 1, 1, 1 ) -[sub_resource type="SpatialMaterial" id=6] -albedo_color = Color( 0, 0, 0, 1 ) +[sub_resource type="SpatialMaterial" id=25] +albedo_texture = ExtResource( 12 ) +uv1_scale = Vector3( 2.553, 0.69, 1 ) +uv1_offset = Vector3( 0.055, 0.327, 0 ) -[sub_resource type="ViewportTexture" id=8] -viewport_path = NodePath("Sprite3D/GeigerViewport") +[sub_resource type="SpatialMaterial" id=26] +albedo_texture = ExtResource( 11 ) +uv1_scale = Vector3( 2.287, 1.197, 1 ) +uv1_offset = Vector3( 0.131, 0.194, 0 ) -[sub_resource type="DynamicFont" id=7] -size = 40 -outline_size = 1 -font_data = ExtResource( 2 ) +[sub_resource type="SpatialMaterial" id=27] +albedo_texture = ExtResource( 10 ) +uv1_scale = Vector3( 1.145, 1.366, 1 ) +uv1_offset = Vector3( 0.372, 0.136, 0 ) -[sub_resource type="ViewportTexture" id=11] -viewport_path = NodePath("Sprite3D2/GeigerViewport") +[sub_resource type="DynamicFont" id=28] +size = 100 +outline_size = 3 +font_data = ExtResource( 3 ) -[sub_resource type="DynamicFont" id=10] +[sub_resource type="DynamicFont" id=29] size = 100 outline_size = 3 font_data = ExtResource( 3 ) [node name="GeigerCounter" type="Spatial"] -[node name="MeshInstance" type="MeshInstance" parent="."] -transform = Transform( 3, 0, 0, 0, 5, 0, 0, 0, 1, 0, -1.49012e-08, 0 ) -mesh = SubResource( 1 ) -skeleton = NodePath("../../../..") -material/0 = SubResource( 2 ) - -[node name="MeshInstance2" type="MeshInstance" parent="."] -transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0.1 ) -mesh = SubResource( 3 ) -material/0 = SubResource( 6 ) - -[node name="Sprite3D" type="Sprite3D" parent="."] -transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.09795e-10, 1.838, 0.634 ) -texture = SubResource( 8 ) - -[node name="GeigerViewport" type="Viewport" parent="Sprite3D"] -size = Vector2( 362, 50 ) -transparent_bg = true -render_target_v_flip = true -script = ExtResource( 1 ) - -[node name="Label" type="Label" parent="Sprite3D/GeigerViewport"] -margin_right = 78.0 -margin_bottom = 14.0 -custom_fonts/font = SubResource( 7 ) -text = "Current Radiation" -align = 1 -valign = 1 - -[node name="Sprite3D2" type="Sprite3D" parent="."] -transform = Transform( 0.35, 0, 0, 0, 0.35, 0, 0, 0, 0.35, 0, 1.126, 0.64 ) -texture = SubResource( 11 ) - -[node name="GeigerViewport" type="Viewport" parent="Sprite3D2"] -size = Vector2( 549, 111 ) -transparent_bg = true -render_target_v_flip = true -script = ExtResource( 1 ) - -[node name="Label" type="Label" parent="Sprite3D2/GeigerViewport"] -margin_right = 40.0 -margin_bottom = 14.0 -custom_fonts/font = SubResource( 10 ) -text = "0.0000000" -align = 1 -valign = 1 - [node name="ClickSound" type="AudioStreamPlayer3D" parent="."] stream = ExtResource( 4 ) script = ExtResource( 5 ) + +[node name="MeshInstance" type="MeshInstance" parent="."] +transform = Transform( 1.5, 0.000250392, -0.00210797, 0.00210788, 0.000523183, 1.5, 0.000251116, -1.5, 0.000522832, -0.0278158, 0.516422, -0.0447059 ) +mesh = ExtResource( 8 ) +material/0 = SubResource( 12 ) +material/1 = SubResource( 19 ) +material/2 = SubResource( 14 ) +material/3 = SubResource( 15 ) +material/4 = SubResource( 20 ) +material/5 = SubResource( 20 ) +material/6 = SubResource( 20 ) +material/7 = SubResource( 14 ) +material/8 = SubResource( 21 ) +material/9 = SubResource( 22 ) +material/10 = SubResource( 23 ) +material/11 = SubResource( 18 ) +material/12 = SubResource( 18 ) + +[node name="Battery" type="MeshInstance" parent="."] +transform = Transform( 0.205, 0, 0, 0, 0.099, 0, 0, 0, 0.001, 0.475, 1.493, 0.512 ) +mesh = SubResource( 24 ) +skeleton = NodePath("") +material/0 = SubResource( 25 ) + +[node name="Sound" type="MeshInstance" parent="."] +transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.001, 0.209346, 1.493, 0.512 ) +mesh = SubResource( 24 ) +skeleton = NodePath("") +material/0 = SubResource( 26 ) + +[node name="Waves" type="MeshInstance" parent="."] +transform = Transform( 0.05, 0, 0, 0, 0.1, 0, 0, 0, 0.001, 0.276648, 1.49226, 0.512 ) +mesh = SubResource( 24 ) +skeleton = NodePath("") +material/0 = SubResource( 27 ) + +[node name="ValueLabel" type="Label3D" parent="."] +transform = Transform( 0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -0.021, 1.075, 0.512 ) +modulate = Color( 0, 0, 0, 1 ) +text = "0.0000000" +font = SubResource( 28 ) + +[node name="UnitsLabel" type="Label3D" parent="."] +transform = Transform( 0.13, 0, 0, 0, 0.13, 0, 0, 0, 0.13, 0.372197, 0.935638, 0.512812 ) +modulate = Color( 0, 0, 0, 1 ) +text = "μSv/hr" +font = SubResource( 29 ) diff --git a/scenes/Instructions1.tscn b/scenes/Instructions1.tscn new file mode 100644 index 0000000..9c7b55b --- /dev/null +++ b/scenes/Instructions1.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Regular.ttf" type="DynamicFontData" id=2] + +[sub_resource type="DynamicFont" id=1] +size = 37 +font_data = ExtResource( 1 ) + +[sub_resource type="DynamicFont" id=2] +size = 37 +font_data = ExtResource( 2 ) + +[node name="Instructions1" type="HBoxContainer"] +margin_right = 40.0 +margin_bottom = 40.0 +rect_pivot_offset = Vector2( -419, -74 ) + +[node name="Title" type="Label" parent="."] +margin_right = 230.0 +margin_bottom = 117.0 +rect_min_size = Vector2( 230, 117 ) +custom_fonts/font = SubResource( 1 ) +text = "Instructions:" + +[node name="Description" type="Label" parent="."] +margin_left = 234.0 +margin_right = 734.0 +margin_bottom = 117.0 +rect_min_size = Vector2( 500, 0 ) +size_flags_stretch_ratio = 2.0 +custom_fonts/font = SubResource( 2 ) +text = "Navigate the facility and receive as little radiation as possible." +autowrap = true diff --git a/scenes/Level1.tscn b/scenes/Level1.tscn new file mode 100644 index 0000000..c0ba206 --- /dev/null +++ b/scenes/Level1.tscn @@ -0,0 +1,75 @@ +[gd_scene load_steps=13 format=2] + +[ext_resource path="res://scripts/Level1.gd" type="Script" id=1] +[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://scenes/RadioactiveRoom.tscn" type="PackedScene" id=3] +[ext_resource path="res://scenes/TabScreen.tscn" type="PackedScene" id=4] +[ext_resource path="res://scenes/PauseScreen.tscn" type="PackedScene" id=5] +[ext_resource path="res://scenes/Instructions1.tscn" type="PackedScene" id=6] +[ext_resource path="res://scenes/Objectives1.tscn" type="PackedScene" id=7] +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=8] +[ext_resource path="res://scenes/ObjNotif.tscn" type="PackedScene" id=9] +[ext_resource path="res://scenes/LvlCompleteScreen.tscn" type="PackedScene" id=10] + +[sub_resource type="BoxShape" id=1] + +[sub_resource type="DynamicFont" id=2] +size = 27 +font_data = ExtResource( 8 ) + +[node name="Level1" type="Node"] +script = ExtResource( 1 ) + +[node name="Player" parent="." instance=ExtResource( 2 )] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 7.27318, 1.2296, -6.6927 ) + +[node name="DirectionalLight" type="DirectionalLight" parent="."] +transform = Transform( 1, 0, 0, 0, 0.551194, 0.834377, 0, -0.834377, 0.551194, 0.0895562, 6.06915, 11.8562 ) + +[node name="RadioactiveRoom" parent="." groups=["sources"] instance=ExtResource( 3 )] + +[node name="TabScreen" parent="." instance=ExtResource( 4 )] +visible = false + +[node name="PauseScreen" parent="." instance=ExtResource( 5 )] + +[node name="InstObj1" type="CanvasLayer" parent="."] +layer = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="InstObj1"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -367.0 +margin_top = -150.0 +margin_right = 367.0 +margin_bottom = 101.0 + +[node name="Instructions1" parent="InstObj1/VBoxContainer" instance=ExtResource( 6 )] +margin_right = 734.0 +margin_bottom = 117.0 + +[node name="Objectives1" parent="InstObj1/VBoxContainer" instance=ExtResource( 7 )] +margin_top = 121.0 +margin_right = 734.0 +margin_bottom = 251.0 + +[node name="ObjNotif" parent="." instance=ExtResource( 9 )] + +[node name="EndZone" type="Area" parent="."] + +[node name="CollisionShape" type="CollisionShape" parent="EndZone"] +transform = Transform( 1.75, 0, 0, 0, 1.25, 0, 0, 0, 1.75, 6.25, 1.25, 6.75 ) +shape = SubResource( 1 ) + +[node name="CompLvlText" type="Label3D" parent="."] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 7.99483, 1.354, 6.803 ) +double_sided = false +text = "[F] Complete Level" +font = SubResource( 2 ) + +[node name="LvlCompleteScreen" parent="." instance=ExtResource( 10 )] + +[connection signal="body_entered" from="EndZone" to="." method="_on_EndZone_body_entered"] +[connection signal="body_exited" from="EndZone" to="." method="_on_EndZone_body_exited"] diff --git a/scenes/LevelSelect.tscn b/scenes/LevelSelect.tscn new file mode 100644 index 0000000..a1c6596 --- /dev/null +++ b/scenes/LevelSelect.tscn @@ -0,0 +1,132 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://text_theme.tres" type="Theme" id=2] +[ext_resource path="res://scripts/LevelSelect.gd" type="Script" id=3] +[ext_resource path="res://textures/RadioactiveRoomThumbnail.png" type="Texture" id=4] + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.784314, 0.231373, 0.231373, 1 ) + +[sub_resource type="Theme" id=3] +Panel/styles/panel = SubResource( 2 ) + +[sub_resource type="DynamicFont" id=1] +size = 70 +font_data = ExtResource( 1 ) + +[node name="LevelSelect" type="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = SubResource( 3 ) +script = ExtResource( 3 ) + +[node name="Label" type="Label" parent="."] +margin_left = 332.0 +margin_top = 10.0 +margin_right = 691.0 +margin_bottom = 118.0 +custom_fonts/font = SubResource( 1 ) +text = "Level Select" +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -447.0 +margin_top = -150.0 +margin_right = 447.0 +margin_bottom = 203.0 +custom_constants/separation = 74 + +[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer"] +margin_right = 410.0 +margin_bottom = 353.0 +rect_min_size = Vector2( 410, 353 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/ScrollContainer"] +margin_right = 395.0 +margin_bottom = 470.0 +custom_constants/separation = 2 + +[node name="LevelButton1" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_right = 395.0 +margin_bottom = 57.0 +rect_min_size = Vector2( 395, 0 ) +theme = ExtResource( 2 ) +text = "1: RadioactiveRoom" + +[node name="LevelButton2" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 59.0 +margin_right = 395.0 +margin_bottom = 116.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="LevelButton3" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 118.0 +margin_right = 395.0 +margin_bottom = 175.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="LevelButton4" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 177.0 +margin_right = 395.0 +margin_bottom = 234.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="LevelButton5" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 236.0 +margin_right = 395.0 +margin_bottom = 293.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="LevelButton6" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 295.0 +margin_right = 395.0 +margin_bottom = 352.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="LevelButton7" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 354.0 +margin_right = 395.0 +margin_bottom = 411.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="LevelButton8" type="Button" parent="HBoxContainer/ScrollContainer/VBoxContainer"] +margin_top = 413.0 +margin_right = 395.0 +margin_bottom = 470.0 +theme = ExtResource( 2 ) +text = "???" + +[node name="ColorRect" type="ColorRect" parent="HBoxContainer"] +margin_left = 484.0 +margin_right = 894.0 +margin_bottom = 353.0 +rect_min_size = Vector2( 410, 353 ) +color = Color( 0.172549, 0.172549, 0.172549, 1 ) + +[node name="TextureRect1" type="TextureRect" parent="HBoxContainer/ColorRect"] +visible = false +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -197.0 +margin_top = 14.0 +margin_right = 627.0 +margin_bottom = 684.0 +rect_scale = Vector2( 0.48, 0.48 ) +texture = ExtResource( 4 ) + +[connection signal="mouse_entered" from="HBoxContainer/ScrollContainer/VBoxContainer/LevelButton1" to="." method="_on_LevelButton1_mouse_entered"] +[connection signal="mouse_exited" from="HBoxContainer/ScrollContainer/VBoxContainer/LevelButton1" to="." method="_on_LevelButton1_mouse_exited"] +[connection signal="pressed" from="HBoxContainer/ScrollContainer/VBoxContainer/LevelButton1" to="." method="_on_LevelButton1_pressed"] diff --git a/scenes/LoadingScreen.tscn b/scenes/LoadingScreen.tscn new file mode 100644 index 0000000..f21f74f --- /dev/null +++ b/scenes/LoadingScreen.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] + +[sub_resource type="DynamicFont" id=1] +size = 70 +font_data = ExtResource( 1 ) + +[sub_resource type="DynamicFont" id=2] +size = 34 +font_data = ExtResource( 1 ) + +[node name="LoadingScreen" type="Node"] + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="ColorRect" type="ColorRect" parent="CanvasLayer"] +margin_right = 1024.0 +margin_bottom = 600.0 +color = Color( 0.556863, 0.556863, 0.556863, 1 ) + +[node name="CanvasLayer2" type="CanvasLayer" parent="."] +layer = 2 + +[node name="Label" type="Label" parent="CanvasLayer2"] +margin_left = 332.0 +margin_top = 200.0 +margin_right = 691.0 +margin_bottom = 308.0 +custom_fonts/font = SubResource( 1 ) +text = "Loading..." +align = 1 + +[node name="ProgressBar" type="ProgressBar" parent="CanvasLayer2"] +margin_left = 162.0 +margin_top = 369.0 +margin_right = 862.0 +margin_bottom = 409.0 +custom_fonts/font = SubResource( 2 ) diff --git a/scenes/LvlCompleteScreen.tscn b/scenes/LvlCompleteScreen.tscn new file mode 100644 index 0000000..06ecd85 --- /dev/null +++ b/scenes/LvlCompleteScreen.tscn @@ -0,0 +1,177 @@ +[gd_scene load_steps=16 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Regular.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://scripts/LvlCompleteScreen.gd" type="Script" id=3] + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.12549, 0.152941, 0.211765, 1 ) + +[sub_resource type="Theme" id=3] +Panel/styles/panel = SubResource( 2 ) + +[sub_resource type="Animation" id=10] +resource_name = "FadeIn" +length = 0.6 +tracks/0/type = "value" +tracks/0/path = NodePath(".:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.6 ), +"transitions": PoolRealArray( 0.517633, 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ] +} + +[sub_resource type="Animation" id=11] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath(".:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 1 ) ] +} + +[sub_resource type="DynamicFont" id=4] +size = 70 +font_data = ExtResource( 1 ) + +[sub_resource type="Theme" id=5] +HBoxContainer/constants/separation = 91 + +[sub_resource type="StyleBoxFlat" id=12] +bg_color = Color( 0.196078, 0.196078, 0.196078, 1 ) + +[sub_resource type="DynamicFont" id=13] +size = 46 +font_data = ExtResource( 1 ) + +[sub_resource type="Theme" id=14] +default_font = SubResource( 13 ) +Button/colors/font_color_hover = Color( 0.631373, 0.631373, 0.631373, 1 ) +Button/colors/font_color_pressed = Color( 0.388235, 0.388235, 0.388235, 1 ) +Button/styles/hover = SubResource( 12 ) + +[sub_resource type="Theme" id=7] +HBoxContainer/constants/separation = 63 + +[sub_resource type="DynamicFont" id=8] +size = 37 +font_data = ExtResource( 1 ) + +[sub_resource type="DynamicFont" id=9] +size = 37 +font_data = ExtResource( 2 ) + +[node name="LvlCompleteScreen" type="Panel"] +pause_mode = 2 +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = SubResource( 3 ) +script = ExtResource( 3 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/FadeIn = SubResource( 10 ) +anims/RESET = SubResource( 11 ) + +[node name="Title" type="Label" parent="."] +margin_top = 3.0 +margin_right = 1024.0 +margin_bottom = 111.0 +custom_fonts/font = SubResource( 4 ) +text = "Level Complete" +align = 1 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Buttons" type="HBoxContainer" parent="."] +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -437.0 +margin_top = -120.0 +margin_right = 435.0 +margin_bottom = -43.0 +theme = SubResource( 5 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="LevelSelectButton" type="Button" parent="Buttons"] +margin_right = 260.0 +margin_bottom = 77.0 +rect_min_size = Vector2( 260, 0 ) +theme = SubResource( 14 ) +text = "Level Select" + +[node name="QuitButton" type="Button" parent="Buttons"] +margin_left = 351.0 +margin_right = 521.0 +margin_bottom = 77.0 +rect_min_size = Vector2( 170, 0 ) +theme = SubResource( 14 ) +text = "Quit" + +[node name="ContinueButton" type="Button" parent="Buttons"] +margin_left = 612.0 +margin_right = 872.0 +margin_bottom = 77.0 +rect_min_size = Vector2( 260, 0 ) +theme = SubResource( 14 ) +text = "Continue" + +[node name="RadiationReceived" type="HBoxContainer" parent="."] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -439.5 +margin_top = 100.0 +margin_right = 439.5 +margin_bottom = 157.0 +theme = SubResource( 7 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Title" type="Label" parent="RadiationReceived"] +margin_right = 316.0 +margin_bottom = 57.0 +rect_min_size = Vector2( 230, 0 ) +custom_fonts/font = SubResource( 8 ) +text = "Radiation Received:" + +[node name="Number" type="Label" parent="RadiationReceived"] +margin_left = 379.0 +margin_right = 879.0 +margin_bottom = 57.0 +rect_min_size = Vector2( 500, 0 ) +size_flags_stretch_ratio = 2.0 +custom_fonts/font = SubResource( 9 ) +text = "0.1112321" +autowrap = true + +[node name="CanvasLayer" type="CanvasLayer" parent="."] +layer = 2 + +[node name="ColorRect" type="ColorRect" parent="CanvasLayer"] +margin_top = 90.0 +margin_right = 1020.0 +margin_bottom = 490.0 +color = Color( 1, 1, 1, 0 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[connection signal="pressed" from="Buttons/LevelSelectButton" to="." method="_on_LevelSelectButton_pressed"] +[connection signal="pressed" from="Buttons/QuitButton" to="." method="_on_QuitButton_pressed"] +[connection signal="pressed" from="Buttons/ContinueButton" to="." method="_on_ContinueButton_pressed"] diff --git a/scenes/Main.tscn b/scenes/Main.tscn deleted file mode 100644 index 0a63d53..0000000 --- a/scenes/Main.tscn +++ /dev/null @@ -1,20 +0,0 @@ -[gd_scene load_steps=5 format=2] - -[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1] -[ext_resource path="res://scripts/Main.gd" type="Script" id=3] -[ext_resource path="res://scenes/RadioactiveRoom.tscn" type="PackedScene" id=5] -[ext_resource path="res://scenes/TabScreen.tscn" type="PackedScene" id=6] - -[node name="Main" type="Node"] -script = ExtResource( 3 ) - -[node name="Player" parent="." instance=ExtResource( 1 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -16.6444, 1.2296, -19.5018 ) - -[node name="DirectionalLight" type="DirectionalLight" parent="."] -transform = Transform( 1, 0, 0, 0, 0.551194, 0.834377, 0, -0.834377, 0.551194, 0.0895562, 6.06915, 11.8562 ) - -[node name="RadioactiveRoom" parent="." groups=["sources"] instance=ExtResource( 5 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -12.0891, 0, -22.197 ) - -[node name="TabScreen" parent="." instance=ExtResource( 6 )] diff --git a/scenes/MainMenu.tscn b/scenes/MainMenu.tscn new file mode 100644 index 0000000..54d2e11 --- /dev/null +++ b/scenes/MainMenu.tscn @@ -0,0 +1,623 @@ +[gd_scene load_steps=55 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://text_theme.tres" type="Theme" id=2] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_Roughness.jpg" type="Texture" id=3] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_Roughness.jpg" type="Texture" id=4] +[ext_resource path="res://scripts/MainMenu.gd" type="Script" id=5] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_NormalGL.jpg" type="Texture" id=6] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_NormalGL.jpg" type="Texture" id=7] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_Displacement.jpg" type="Texture" id=8] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_Color.jpg" type="Texture" id=9] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_Displacement.jpg" type="Texture" id=10] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_Color.jpg" type="Texture" id=11] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_Roughness.jpg" type="Texture" id=12] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_Color.jpg" type="Texture" id=13] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_Displacement.jpg" type="Texture" id=14] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_Color.jpg" type="Texture" id=15] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_NormalGL.jpg" type="Texture" id=16] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_Roughness.jpg" type="Texture" id=17] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_Displacement.jpg" type="Texture" id=18] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_NormalGL.jpg" type="Texture" id=19] +[ext_resource path="res://models/TwoRoomModel.obj" type="ArrayMesh" id=20] + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.439216, 0.439216, 0.439216, 0 ) + +[sub_resource type="Theme" id=3] +Panel/styles/panel = SubResource( 2 ) + +[sub_resource type="DynamicFont" id=1] +size = 70 +outline_size = 7 +outline_color = Color( 0.419608, 0.027451, 0.027451, 1 ) +font_data = ExtResource( 1 ) + +[sub_resource type="Theme" id=35] +default_font = SubResource( 1 ) + +[sub_resource type="Animation" id=6] +resource_name = "Move0" +length = 16.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Camera:translation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 16 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 3.6496, 0.985948, 4.24741 ), Vector3( 3.86477, 0.974733, 1.59468 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Camera:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 16 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 0.12379, 48.7857, 0.162747 ), Vector3( -0.142681, 83.5207, 0.312021 ) ] +} + +[sub_resource type="Animation" id=4] +resource_name = "Move1" +length = 10.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Camera:translation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 10 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 2, 1.806, -8.219 ), Vector3( 0.39, 1.6, -8.219 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Camera:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 10 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 0, 165.073, 0 ), Vector3( 0, 200, 0 ) ] +} + +[sub_resource type="Animation" id=7] +resource_name = "Move2" +length = 20.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Camera:translation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 20 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 0.769132, 1.39385, 8.10579 ), Vector3( 6.50013, 1.39385, 8.10579 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Camera:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 20 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( -0.142681, -12.7953, 0.312021 ), Vector3( -0.142681, 38.3017, 0.312021 ) ] +} + +[sub_resource type="Animation" id=33] +resource_name = "Move3" +length = 22.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Camera:translation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 22 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( -2.28626, 1.55487, -7.91189 ), Vector3( -1.5, 1.684, -3 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Camera:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 22 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( -0.157587, -96.4564, 0.247683 ), Vector3( 0, -175, 0 ) ] +} + +[sub_resource type="Animation" id=5] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Camera:translation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Vector3( 3.45791, 1.80574, -8.21942 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Camera:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Vector3( 0, 165.073, 0 ) ] +} + +[sub_resource type="SpatialMaterial" id=8] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 14, 1 ) +uv1_offset = Vector3( 0.338, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=9] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 8, 1 ) + +[sub_resource type="SpatialMaterial" id=10] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 3.5, 1 ) +uv1_offset = Vector3( 0, 0.03, 0 ) + +[sub_resource type="SpatialMaterial" id=11] +albedo_texture = ExtResource( 15 ) +roughness_texture = ExtResource( 17 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 19 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 5, 7.5, 1 ) + +[sub_resource type="SpatialMaterial" id=12] +albedo_texture = ExtResource( 13 ) +roughness_texture = ExtResource( 4 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 7 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 18 ) +uv1_scale = Vector3( 3.5, 5, 1 ) + +[sub_resource type="SpatialMaterial" id=13] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 3.5, 1 ) +uv1_offset = Vector3( 0, 0.362, 0 ) + +[sub_resource type="SpatialMaterial" id=14] +flags_transparent = true +albedo_color = Color( 0.294118, 0.294118, 0.294118, 0.564706 ) +roughness = 0.0 + +[sub_resource type="SpatialMaterial" id=15] +flags_transparent = true +albedo_color = Color( 0, 1, 0.0666667, 1 ) +metallic = 0.5 +roughness = 0.0 + +[sub_resource type="SpatialMaterial" id=16] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 15, 1 ) + +[sub_resource type="SpatialMaterial" id=17] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 6, 1 ) + +[sub_resource type="SpatialMaterial" id=18] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 0.75, 1 ) + +[sub_resource type="SpatialMaterial" id=19] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 5.6, 1 ) + +[sub_resource type="SpatialMaterial" id=20] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 16.8, 1 ) +uv1_offset = Vector3( 0.371, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=21] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 25.9, 1 ) +uv1_offset = Vector3( 0.25, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=22] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 25.9, 1 ) +uv1_offset = Vector3( 0.572, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=23] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 0.7, 1 ) +uv1_offset = Vector3( 0.572, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=24] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 5.6, 1 ) +uv1_offset = Vector3( 0.572, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=25] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 9, 1 ) + +[sub_resource type="SpatialMaterial" id=26] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 18, 1 ) + +[sub_resource type="SpatialMaterial" id=27] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 27, 1 ) + +[sub_resource type="SpatialMaterial" id=28] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 0.75, 1 ) + +[sub_resource type="SpatialMaterial" id=29] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 15, 1 ) + +[sub_resource type="SpatialMaterial" id=30] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 6, 1 ) + +[sub_resource type="SpatialMaterial" id=31] +albedo_texture = ExtResource( 9 ) +roughness_texture = ExtResource( 3 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 8 ) +uv1_scale = Vector3( 0.35, 8, 1 ) + +[sub_resource type="SpatialMaterial" id=32] +albedo_texture = ExtResource( 11 ) +roughness_texture = ExtResource( 12 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 14 ) +uv1_scale = Vector3( 4, 0.7, 1 ) +uv1_offset = Vector3( 0.106, 0, 0 ) + +[node name="MainMenu" type="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = SubResource( 3 ) +script = ExtResource( 5 ) + +[node name="Title" type="Label" parent="."] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -475.0 +margin_top = 30.0 +margin_right = 475.0 +margin_bottom = 138.0 +theme = SubResource( 35 ) +text = "Radiation Detection Simulator" +align = 1 +valign = 1 + +[node name="StartButton" type="Button" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -125.0 +margin_top = -90.0 +margin_right = 125.0 +margin_bottom = 14.0 +theme = ExtResource( 2 ) +text = "Start" + +[node name="QuitButton" type="Button" parent="."] +anchor_left = -0.000976563 +anchor_top = 0.0333333 +anchor_right = -0.000976563 +anchor_bottom = 0.0333333 +margin_left = 388.0 +margin_top = 355.0 +margin_right = 636.0 +margin_bottom = 459.0 +theme = ExtResource( 2 ) +text = "Quit" + +[node name="Camera" type="Camera" parent="."] +transform = Transform( -0.966255, 0, 0.257588, 0, 1, 0, -0.257588, 0, -0.966255, 3.45791, 1.80574, -8.21942 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/Move0 = SubResource( 6 ) +anims/Move1 = SubResource( 4 ) +anims/Move2 = SubResource( 7 ) +anims/Move3 = SubResource( 33 ) +anims/RESET = SubResource( 5 ) + +[node name="RadioactiveRoomMesh" type="MeshInstance" parent="."] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 4.5, -0.5, -5.5 ) +mesh = ExtResource( 20 ) +material/0 = SubResource( 8 ) +material/1 = SubResource( 8 ) +material/2 = SubResource( 9 ) +material/3 = SubResource( 10 ) +material/4 = SubResource( 11 ) +material/5 = SubResource( 12 ) +material/6 = SubResource( 13 ) +material/7 = SubResource( 14 ) +material/8 = SubResource( 15 ) +material/9 = SubResource( 16 ) +material/10 = SubResource( 16 ) +material/11 = SubResource( 17 ) +material/12 = SubResource( 18 ) +material/13 = SubResource( 17 ) +material/14 = SubResource( 18 ) +material/15 = SubResource( 17 ) +material/16 = SubResource( 17 ) +material/17 = SubResource( 18 ) +material/18 = SubResource( 19 ) +material/19 = SubResource( 20 ) +material/20 = SubResource( 21 ) +material/21 = SubResource( 22 ) +material/22 = SubResource( 22 ) +material/23 = SubResource( 23 ) +material/24 = SubResource( 24 ) +material/25 = SubResource( 25 ) +material/26 = SubResource( 26 ) +material/27 = SubResource( 26 ) +material/28 = SubResource( 27 ) +material/29 = SubResource( 27 ) +material/30 = SubResource( 28 ) +material/31 = SubResource( 29 ) +material/32 = SubResource( 30 ) +material/33 = SubResource( 31 ) +material/34 = SubResource( 32 ) +material/35 = SubResource( 23 ) +material/36 = SubResource( 23 ) + +[node name="OmniLight" type="OmniLight" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.61853, 2.34849, 3.19597 ) + +[node name="OmniLight2" type="OmniLight" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.61853, 2.34849, -2.54027 ) + +[node name="DirectionalLight" type="DirectionalLight" parent="."] +transform = Transform( 1, 0, 0, 0, 0.551194, 0.834377, 0, -0.834377, 0.551194, 0.0895562, 6.06915, 11.8562 ) + +[connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"] +[connection signal="pressed" from="QuitButton" to="." method="_on_QuitButton_pressed"] diff --git a/scenes/ObjNotif.tscn b/scenes/ObjNotif.tscn new file mode 100644 index 0000000..f7a7261 --- /dev/null +++ b/scenes/ObjNotif.tscn @@ -0,0 +1,75 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://scripts/ObjNotif.gd" type="Script" id=2] + +[sub_resource type="StyleBoxFlat" id=4] +bg_color = Color( 0.0588235, 0.513726, 0.631373, 1 ) + +[sub_resource type="Theme" id=5] +Panel/styles/panel = SubResource( 4 ) + +[sub_resource type="DynamicFont" id=1] +size = 27 +font_data = ExtResource( 1 ) + +[sub_resource type="Animation" id=2] +resource_name = "Fade" +length = 3.0 +tracks/0/type = "value" +tracks/0/path = NodePath(".:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.5, 2, 3 ), +"transitions": PoolRealArray( 1, 1, 1.51572, 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] +} + +[sub_resource type="Animation" id=3] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath(".:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 1 ) ] +} + +[node name="ObjNotif" type="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 112.0 +margin_top = 422.0 +margin_right = -112.0 +margin_bottom = -178.0 +rect_min_size = Vector2( 800, 42 ) +theme = SubResource( 5 ) +script = ExtResource( 2 ) + +[node name="Label" type="Label" parent="."] +margin_right = 250.0 +margin_bottom = 42.0 +rect_min_size = Vector2( 800, 0 ) +custom_fonts/font = SubResource( 1 ) +text = "Objective Completed:" +align = 1 +valign = 1 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/Fade = SubResource( 2 ) +anims/RESET = SubResource( 3 ) + +[node name="Timer" type="Timer" parent="."] +wait_time = 5.0 +one_shot = true + +[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/scenes/Objectives1.tscn b/scenes/Objectives1.tscn new file mode 100644 index 0000000..36acd2a --- /dev/null +++ b/scenes/Objectives1.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://textures/Checkedbox.png" type="Texture" id=2] +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Regular.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://textures/Uncheckedbox.png" type="Texture" id=4] + +[sub_resource type="DynamicFont" id=7] +size = 37 +font_data = ExtResource( 1 ) + +[sub_resource type="DynamicFont" id=6] +size = 36 +font_data = ExtResource( 3 ) + +[sub_resource type="Theme" id=8] +default_font = SubResource( 6 ) +CheckBox/colors/font_color_pressed = Color( 0, 1, 0.109804, 1 ) +CheckBox/icons/checked = ExtResource( 2 ) +CheckBox/icons/unchecked = ExtResource( 4 ) + +[node name="Objectives1" type="HBoxContainer"] +margin_right = 40.0 +margin_bottom = 40.0 +rect_pivot_offset = Vector2( -326, -82 ) + +[node name="Title" type="Label" parent="."] +margin_right = 230.0 +margin_bottom = 130.0 +rect_min_size = Vector2( 230, 130 ) +custom_fonts/font = SubResource( 7 ) +text = "Objectives:" + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 234.0 +margin_right = 721.0 +margin_bottom = 130.0 + +[node name="CheckBox" type="CheckBox" parent="VBoxContainer"] +margin_right = 487.0 +margin_bottom = 63.0 +theme = SubResource( 8 ) +text = "Reach the End Zone" + +[node name="CheckBox2" type="CheckBox" parent="VBoxContainer"] +margin_top = 67.0 +margin_right = 487.0 +margin_bottom = 130.0 +theme = SubResource( 8 ) +text = "See the Radioactive Cylinder" diff --git a/scenes/PauseScreen.tscn b/scenes/PauseScreen.tscn new file mode 100644 index 0000000..8407ed6 --- /dev/null +++ b/scenes/PauseScreen.tscn @@ -0,0 +1,73 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://scripts/PauseScreen.gd" type="Script" id=2] + +[sub_resource type="StyleBoxFlat" id=15] +bg_color = Color( 0.0117647, 0.188235, 0.282353, 0.603922 ) + +[sub_resource type="Theme" id=16] +Panel/styles/panel = SubResource( 15 ) + +[sub_resource type="StyleBoxFlat" id=12] +bg_color = Color( 0.196078, 0.196078, 0.196078, 1 ) + +[sub_resource type="DynamicFont" id=13] +size = 46 +font_data = ExtResource( 1 ) + +[sub_resource type="Theme" id=14] +default_font = SubResource( 13 ) +Button/colors/font_color_hover = Color( 0.631373, 0.631373, 0.631373, 1 ) +Button/colors/font_color_pressed = Color( 0.388235, 0.388235, 0.388235, 1 ) +Button/styles/hover = SubResource( 12 ) + +[sub_resource type="DynamicFont" id=3] +size = 70 +font_data = ExtResource( 1 ) + +[node name="PauseScreen" type="Panel"] +pause_mode = 2 +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = SubResource( 16 ) +script = ExtResource( 2 ) + +[node name="CanvasLayer" type="CanvasLayer" parent="."] +layer = 3 + +[node name="ColorRect" type="ColorRect" parent="CanvasLayer"] +margin_top = 90.0 +margin_right = 1020.0 +margin_bottom = 490.0 +color = Color( 1, 1, 1, 0 ) + +[node name="QuitButton" type="Button" parent="."] +margin_left = 637.0 +margin_top = 501.0 +margin_right = 899.0 +margin_bottom = 578.0 +theme = SubResource( 14 ) +text = "Quit" + +[node name="LevelSelectButton" type="Button" parent="."] +margin_left = 125.0 +margin_top = 500.0 +margin_right = 387.0 +margin_bottom = 577.0 +theme = SubResource( 14 ) +text = "Level Select" + +[node name="Title" type="Label" parent="."] +margin_top = 3.0 +margin_right = 1024.0 +margin_bottom = 111.0 +custom_fonts/font = SubResource( 3 ) +text = "Game Paused" +align = 1 +__meta__ = { +"_edit_use_anchors_": true +} + +[connection signal="pressed" from="QuitButton" to="." method="_on_QuitButton_pressed"] +[connection signal="pressed" from="LevelSelectButton" to="." method="_on_LevelSelectButton_pressed"] diff --git a/scenes/Player.tscn b/scenes/Player.tscn index 6516763..e196159 100644 --- a/scenes/Player.tscn +++ b/scenes/Player.tscn @@ -21,7 +21,7 @@ transform = Transform( 0.25, 0, 0, 0, -1.09278e-08, -0.25, 0, 0.25, -1.09278e-08 shape = SubResource( 5 ) [node name="MeshInstance" type="MeshInstance" parent="."] -transform = Transform( 0.5, 0, 0, 0, -2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0 ) +transform = Transform( 0.3, 0, 0, 0, 0, -0.3, 0, 0.3, 0, 0, 0, 0 ) mesh = SubResource( 6 ) material/0 = SubResource( 7 ) @@ -32,4 +32,4 @@ script = ExtResource( 2 ) [node name="Camera" type="Camera" parent="CameraJoint"] [node name="GeigerCounter" parent="CameraJoint/Camera" instance=ExtResource( 3 )] -transform = Transform( 0.0469192, 0, -0.0172797, 0, 0.05, 0, 0.0172797, 0, 0.0469192, 0.231, -0.098, -0.7 ) +transform = Transform( 0.0469192, 0, -0.0172797, 0, 0.05, 0, 0.0172797, 0, 0.0469192, 0.208276, -0.0759904, -0.277737 ) diff --git a/scenes/RadioactiveRoom.tscn b/scenes/RadioactiveRoom.tscn index f5b3025..7b311b4 100644 --- a/scenes/RadioactiveRoom.tscn +++ b/scenes/RadioactiveRoom.tscn @@ -1,13 +1,24 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=55 format=2] [ext_resource path="res://scripts/RadioactiveRoom.gd" type="Script" id=1] [ext_resource path="res://tworoomModel.obj" type="ArrayMesh" id=2] - -[sub_resource type="CylinderMesh" id=7] -height = 1.0 - -[sub_resource type="SpatialMaterial" id=6] -albedo_color = Color( 0.0117647, 0.933333, 0.00392157, 1 ) +[ext_resource path="res://models/TwoRoomModel.obj" type="ArrayMesh" id=3] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_Color.jpg" type="Texture" id=4] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_Roughness.jpg" type="Texture" id=5] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_NormalGL.jpg" type="Texture" id=6] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_NormalGL.jpg" type="Texture" id=7] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_Color.jpg" type="Texture" id=8] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_Roughness.jpg" type="Texture" id=9] +[ext_resource path="res://textures/WhitePlaster/Plaster001_1K-JPG_Displacement.jpg" type="Texture" id=10] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_Displacement.jpg" type="Texture" id=11] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_Color.jpg" type="Texture" id=12] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_NormalGL.jpg" type="Texture" id=13] +[ext_resource path="res://textures/TiledFloor/Tiles051_1K-JPG_Roughness.jpg" type="Texture" id=14] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_Roughness.jpg" type="Texture" id=15] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_NormalGL.jpg" type="Texture" id=16] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_Displacement.jpg" type="Texture" id=17] +[ext_resource path="res://textures/Wood2/Wood058_1K-JPG_Color.jpg" type="Texture" id=18] +[ext_resource path="res://textures/CeilingTile/OfficeCeiling001_1K-JPG_Displacement.jpg" type="Texture" id=19] [sub_resource type="CubeMesh" id=1] size = Vector3( 1, 1, 1 ) @@ -20,21 +31,533 @@ albedo_color = Color( 1, 0, 0, 0.458824 ) flags_transparent = true albedo_color = Color( 1, 1, 1, 0.270588 ) +[sub_resource type="SpatialMaterial" id=9] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 14, 1 ) +uv1_offset = Vector3( 0.338, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=10] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 8, 1 ) + +[sub_resource type="SpatialMaterial" id=11] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 3.5, 1 ) +uv1_offset = Vector3( 0, 0.03, 0 ) + +[sub_resource type="SpatialMaterial" id=21] +albedo_texture = ExtResource( 4 ) +roughness_texture = ExtResource( 5 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 7 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 19 ) +uv1_scale = Vector3( 5, 7.5, 1 ) + +[sub_resource type="SpatialMaterial" id=22] +albedo_texture = ExtResource( 12 ) +roughness_texture = ExtResource( 14 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 13 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 11 ) +uv1_scale = Vector3( 3.5, 5, 1 ) + +[sub_resource type="SpatialMaterial" id=12] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 3.5, 1 ) +uv1_offset = Vector3( 0, 0.362, 0 ) + +[sub_resource type="SpatialMaterial" id=23] +flags_transparent = true +albedo_color = Color( 0.294118, 0.294118, 0.294118, 0 ) +roughness = 0.0 + +[sub_resource type="SpatialMaterial" id=24] +flags_transparent = true +albedo_color = Color( 0, 1, 0.0666667, 0 ) +metallic = 0.5 +roughness = 0.0 + +[sub_resource type="SpatialMaterial" id=25] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 15, 1 ) + +[sub_resource type="SpatialMaterial" id=26] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 6, 1 ) + +[sub_resource type="SpatialMaterial" id=27] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 0.75, 1 ) + +[sub_resource type="SpatialMaterial" id=14] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 5.6, 1 ) + +[sub_resource type="SpatialMaterial" id=15] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 16.8, 1 ) +uv1_offset = Vector3( 0.371, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=16] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 25.9, 1 ) +uv1_offset = Vector3( 0.25, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=17] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 25.9, 1 ) +uv1_offset = Vector3( 0.572, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=18] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 0.7, 1 ) +uv1_offset = Vector3( 0.572, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=19] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 5.6, 1 ) +uv1_offset = Vector3( 0.572, 0, 0 ) + +[sub_resource type="SpatialMaterial" id=28] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 9, 1 ) + +[sub_resource type="SpatialMaterial" id=29] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 18, 1 ) + +[sub_resource type="SpatialMaterial" id=30] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 27, 1 ) + +[sub_resource type="SpatialMaterial" id=31] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 0.75, 1 ) + +[sub_resource type="SpatialMaterial" id=32] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 15, 1 ) + +[sub_resource type="SpatialMaterial" id=33] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 6, 1 ) + +[sub_resource type="SpatialMaterial" id=34] +albedo_texture = ExtResource( 18 ) +roughness_texture = ExtResource( 15 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 16 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 17 ) +uv1_scale = Vector3( 0.35, 8, 1 ) + +[sub_resource type="SpatialMaterial" id=20] +albedo_texture = ExtResource( 8 ) +roughness_texture = ExtResource( 9 ) +normal_enabled = true +normal_scale = -1.0 +normal_texture = ExtResource( 6 ) +depth_enabled = true +depth_scale = -0.01 +depth_deep_parallax = false +depth_flip_tangent = false +depth_flip_binormal = false +depth_texture = ExtResource( 10 ) +uv1_scale = Vector3( 4, 0.7, 1 ) +uv1_offset = Vector3( 0.106, 0, 0 ) + +[sub_resource type="BoxShape" id=37] +extents = Vector3( 0.5, 0.5, 0.5 ) + +[sub_resource type="CubeMesh" id=38] +size = Vector3( 1, 1, 1 ) + +[sub_resource type="SpatialMaterial" id=39] +flags_transparent = true +albedo_color = Color( 0.294118, 0.294118, 0.294118, 0.564706 ) +roughness = 0.0 + +[sub_resource type="CylinderShape" id=41] +height = 1.0 + +[sub_resource type="CylinderMesh" id=40] +height = 1.0 + +[sub_resource type="SpatialMaterial" id=36] +albedo_color = Color( 0, 1, 0.0666667, 1 ) +metallic = 0.5 +roughness = 0.0 + +[sub_resource type="BoxShape" id=35] + [node name="RadioactiveRoom" type="Spatial"] script = ExtResource( 1 ) -[node name="Cylinder" type="MeshInstance" parent="."] -transform = Transform( 0.2, 0, 0, 0, 1, 0, 0, 0, 0.2, 1.95, 0.5, 0.975 ) -mesh = SubResource( 7 ) -skeleton = NodePath("../Room") -material/0 = SubResource( 6 ) - [node name="CurrentVoxel" type="MeshInstance" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0 ) +visible = false mesh = SubResource( 1 ) material/0 = SubResource( 2 ) [node name="Room" type="MeshInstance" parent="."] transform = Transform( -0.01, 8.74228e-10, 3.82137e-17, 0, -4.37114e-10, 0.01, 8.74228e-10, 0.01, 4.37114e-10, 4.452, -0.5, -5.521 ) +visible = false mesh = ExtResource( 2 ) material/0 = SubResource( 8 ) + +[node name="MeshInstance" type="MeshInstance" parent="."] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 4.5, -0.5, -5.5 ) +mesh = ExtResource( 3 ) +material/0 = SubResource( 9 ) +material/1 = SubResource( 9 ) +material/2 = SubResource( 10 ) +material/3 = SubResource( 11 ) +material/4 = SubResource( 21 ) +material/5 = SubResource( 22 ) +material/6 = SubResource( 12 ) +material/7 = SubResource( 23 ) +material/8 = SubResource( 24 ) +material/9 = SubResource( 25 ) +material/10 = SubResource( 25 ) +material/11 = SubResource( 26 ) +material/12 = SubResource( 27 ) +material/13 = SubResource( 26 ) +material/14 = SubResource( 27 ) +material/15 = SubResource( 26 ) +material/16 = SubResource( 26 ) +material/17 = SubResource( 27 ) +material/18 = SubResource( 14 ) +material/19 = SubResource( 15 ) +material/20 = SubResource( 16 ) +material/21 = SubResource( 17 ) +material/22 = SubResource( 17 ) +material/23 = SubResource( 18 ) +material/24 = SubResource( 19 ) +material/25 = SubResource( 28 ) +material/26 = SubResource( 29 ) +material/27 = SubResource( 29 ) +material/28 = SubResource( 30 ) +material/29 = SubResource( 30 ) +material/30 = SubResource( 31 ) +material/31 = SubResource( 32 ) +material/32 = SubResource( 33 ) +material/33 = SubResource( 34 ) +material/34 = SubResource( 20 ) +material/35 = SubResource( 18 ) +material/36 = SubResource( 18 ) + +[node name="OmniLight" type="OmniLight" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.61853, 2.34849, 3.19597 ) + +[node name="OmniLight2" type="OmniLight" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.61853, 2.34849, -2.54027 ) + +[node name="GlassWall" type="StaticBody" parent="."] +transform = Transform( 0.05, 0, 0, 0, 1.5, 0, 0, 0, 2, 2.475, 0.75, 1 ) + +[node name="CollisionShape" type="CollisionShape" parent="GlassWall"] +shape = SubResource( 37 ) + +[node name="MeshInstance" type="MeshInstance" parent="GlassWall"] +mesh = SubResource( 38 ) +material/0 = SubResource( 39 ) + +[node name="Cylinder" type="StaticBody" parent="."] +transform = Transform( 0.2, 0, 0, 0, 1, 0, 0, 0, 0.2, 2, 0.5, 1 ) + +[node name="CollisionShape" type="CollisionShape" parent="Cylinder"] +shape = SubResource( 41 ) + +[node name="MeshInstance" type="MeshInstance" parent="Cylinder"] +mesh = SubResource( 40 ) +material/0 = SubResource( 36 ) + +[node name="Wall" type="StaticBody" parent="."] +transform = Transform( 1, 0, 0, 0, 1.25, 0, 0, 0, 0.25, 2, 1.25, -0.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall2" type="StaticBody" parent="."] +transform = Transform( 3, 0, 0, 0, 1.25, 0, 0, 0, 0.25, 5, 1.25, -5.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall2"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall3" type="StaticBody" parent="."] +transform = Transform( 1, 0, 0, 0, 1.25, 0, 0, 0, 0.25, 2, 1.25, 4.75 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall3"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall4" type="StaticBody" parent="."] +transform = Transform( 6, 0, 0, 0, 1.25, 0, 0, 0, 0.25, 2.5, 1.25, -9.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall4"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall5" type="StaticBody" parent="."] +transform = Transform( 6, 0, 0, 0, 1.25, 0, 0, 0, 0.25, 2.5, 1.25, 8.75 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall5"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall6" type="StaticBody" parent="."] +transform = Transform( 1.75, 0, 0, 0, 1.25, 0, 0, 0, 0.25, 6.25, 1.25, 4.75 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall6"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall7" type="StaticBody" parent="."] +transform = Transform( 0.25, 0, 0, 0, 1.25, 0, 0, 0, 8.75, 8.25, 1.25, -0.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall7"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall8" type="StaticBody" parent="."] +transform = Transform( 0.25, 0, 0, 0, 1.25, 0, 0, 0, 8.75, -3.25, 1.25, -0.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall8"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall9" type="StaticBody" parent="."] +transform = Transform( 0.25, 0, 0, 0, 1.25, 0, 0, 0, 5, 4.25, 1.25, 0 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall9"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Wall10" type="StaticBody" parent="."] +transform = Transform( 0.25, 0, 0, 0, 1.25, 0, 0, 0, 5.25, 0.75, 1.25, -0.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Wall10"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Floor" type="StaticBody" parent="."] +transform = Transform( 6, 0, 0, 0, 0.25, 0, 0, 0, 9.25, 2.5, -0.25, -0.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Floor"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) + +[node name="Ceiling" type="StaticBody" parent="."] +transform = Transform( 6, 0, 0, 0, 0.25, 0, 0, 0, 9.25, 2.5, 2.75, -0.25 ) + +[node name="CollisionShape" type="CollisionShape" parent="Ceiling"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 1.49012e-08, 0 ) +shape = SubResource( 35 ) diff --git a/scripts/CameraJoint.gd b/scripts/CameraJoint.gd index d2fb42b..ac5b8f3 100644 --- a/scripts/CameraJoint.gd +++ b/scripts/CameraJoint.gd @@ -1,21 +1,17 @@ extends SpringArm - var mouse_sensitivity = 0.5 var scroll_speed = 40 const MAX_SPRING_LENGTH = 7; const INITIAL_SPRING_LENGTH = 3; +# paths to nodes to improve performance +onready var GeigerCounter = $Camera/GeigerCounter # Called when the node enters the scene tree for the first time. func _ready(): set_as_toplevel(true) - spring_length = 0 - # GeigerCounter is in correct initial position, but if we want the camera - # to start as zoomed out we must subtract that zoom from the GeigerCounter to - # make sure it stays in the same place - spring_length += INITIAL_SPRING_LENGTH - $Camera/GeigerCounter.translation.z -= INITIAL_SPRING_LENGTH + spring_length = 0 # start in 1st person mode func _physics_process(delta): # calculate the absolute zoom amount based on whether we scroll in or out @@ -27,7 +23,7 @@ func _physics_process(delta): spring_length = clamp(spring_length + zoom, 0, MAX_SPRING_LENGTH) # make geiger counter move in opposite direction so it appears stationary - $Camera/GeigerCounter.translation.z -= zoom + GeigerCounter.translation.z -= zoom # if the player is fully zoomed in (1st person mode), move mouse to center of screen and # lock it there diff --git a/scripts/ClickSound.gd b/scripts/ClickSound.gd index 4f575a9..c7bd6e9 100644 --- a/scripts/ClickSound.gd +++ b/scripts/ClickSound.gd @@ -6,7 +6,6 @@ const RADIATION_MAX = 0.1 # radiation value that will cause the most clicking const SOUND_START = 0.3 # when the click sound plays in the .ogg file var radiation = 0 # total radiation at Geiger Counter's location - func _process(delta): # the more radiation there is, the more likely a sound will be played diff --git a/scripts/GeigerViewport.gd b/scripts/GeigerViewport.gd deleted file mode 100644 index 1e878b1..0000000 --- a/scripts/GeigerViewport.gd +++ /dev/null @@ -1,6 +0,0 @@ -tool # makes this script run in the editor -extends Viewport - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta): - size = $Label.rect_size diff --git a/scripts/Global.gd b/scripts/Global.gd new file mode 100644 index 0000000..dd2bbc9 --- /dev/null +++ b/scripts/Global.gd @@ -0,0 +1,103 @@ +extends Node + +onready var loading_scene = preload("res://scenes/LoadingScreen.tscn") +var current_scene + +func _ready(): + var root = get_tree().root + current_scene = root.get_child(root.get_child_count() - 1) + +# Use this function for loading in scenes which take a long time to load +# next_scene: filepath to the scene you want +func load_scene(next_scene): + # add loading scene to root + var loading_scene_instance = loading_scene.instance() + get_tree().get_root().call_deferred("add_child", loading_scene_instance) + + # start loading the next scene + var loader = ResourceLoader.load_interactive(next_scene) + # check for errors + if loader == null: + print("error occurred while getting the NEXT scene") + pass + + # remove current scene from root + current_scene.queue_free() + # wait for 0.5s for loading scene to appear + yield(get_tree().create_timer(1), "timeout") + + # load next scene using poll() + # poll() needs to be in a loop because it loads data in chunks + var loader_stage_mult = 100.0 / loader.get_stage_count() + while true: + var status = loader.poll() + # a chunk of data was loaded + if status == OK: + # update progress bar according to amount of data loaded + var progress_bar = loading_scene_instance.get_node("./CanvasLayer2/ProgressBar") + progress_bar.value = float(loader.get_stage()) * loader_stage_mult + + # finished loading next scene + elif status == ERR_FILE_EOF: + # create instance of next scene + var next_scene_instance = loader.get_resource().instance() + # add it to root + get_tree().get_root().call_deferred("add_child", next_scene_instance) + # set it as the new current_scene + current_scene = next_scene_instance + # remove loading scene + loading_scene_instance.queue_free() + # housekeeping to make sure game is unpaused and player can move mouse + make_game_playable() + return + + # an error occurred while loading + else: + print("error occurred when loading NEXT scene") + return + +# Use this function to change to scenes that load quickly +# This is a replacement of the change_scene() function +# next_scene: filepath to the scene you want +func go_to_scene(next_scene): + # use call_deferred because the current_scene might still be executing code + # call_deferred runs when nothing else is running + call_deferred("_deferred_go_to_scene", next_scene) + +func _deferred_go_to_scene(next_scene): + # remove the current scene + current_scene.free() + # load the next scene + var s = ResourceLoader.load(next_scene) + # instance the next scene + current_scene = s.instance() + # Add it to the active scene, as child of root. + get_tree().root.add_child(current_scene) + # housekeeping to make sure game is unpaused and player can move mouse + make_game_playable() + +func make_game_playable(): + # unpause the game + get_tree().paused = false + # let player move mouse + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + +# raycasts from the camera to the object to see if there are no objects between them +# ignore: array of objects to ignore in the raycast +# returns true if there are no objects between them, false otherwise +func camera_sees_object(camera, object, ignore): + # get fov of the camera + var half_camera_fov = camera.fov / 2.0 + # raycast from camera to object + var space = get_viewport().world.direct_space_state + var obj_between = space.intersect_ray(camera.global_transform.origin, object.global_transform.origin, ignore) + # check if there's nothing between camera and object + if obj_between and obj_between.collider == object: + # check if the object is in the camera's FOV (using dot product and angles) + var cam_vector = -1 * camera.get_global_transform().basis.z + var cam_to_obj_vector = object.global_transform.origin - camera.global_transform.origin + var dot_product = cam_vector.dot(cam_to_obj_vector) + var angle = acos(dot_product / (cam_vector.length() * cam_to_obj_vector.length())) + var angle_deg = rad2deg(angle) + # camera saw the object if the object is in Camera's FOV + return (angle_deg <= half_camera_fov and angle_deg >= (-1) * half_camera_fov) diff --git a/scripts/Level1.gd b/scripts/Level1.gd new file mode 100644 index 0000000..12f6f79 --- /dev/null +++ b/scripts/Level1.gd @@ -0,0 +1,133 @@ +extends Node + +var sources # all the radioactive sources in the scene +var accumulated_radiation # total radiation accumulated over time + +# bools for objectives +onready var saw_cylinder = false # whether the player has seen the cylinder +onready var reached_end_zone = false # whether the player has made it to the end of the level +onready var lvl_complete = false # prevent player from spamming "f" at the EndZone + +# paths to nodes to improve performance +onready var GC_ClickSound = $Player/CameraJoint/Camera/GeigerCounter/ClickSound +onready var GeigerCounter = $Player/CameraJoint/Camera/GeigerCounter +onready var PlayerCamera = $Player/CameraJoint/Camera +onready var Player = $Player +onready var Cylinder = $RadioactiveRoom/Cylinder +onready var GlassWall = $RadioactiveRoom/GlassWall +onready var RadiationText = $TabScreen/RadiationText +onready var ReachEndZoneObj = $InstObj1/VBoxContainer/Objectives1/VBoxContainer/CheckBox +onready var SeeCylinderObj = $InstObj1/VBoxContainer/Objectives1/VBoxContainer/CheckBox2 +onready var CompLvlText = $CompLvlText +onready var LvlCompleteScreen = $LvlCompleteScreen +onready var RadiationReceived = $LvlCompleteScreen/RadiationReceived + +# Called when the node enters the scene tree for the first time. +func _ready(): + sources = get_tree().get_nodes_in_group("sources") + accumulated_radiation = 0.0 + # pass reference of InstObj to PauseScreen + $PauseScreen.InstObj = $InstObj1 + # hide InstObj (pause screen is not visible at start) + $InstObj1.visible = false + # hide the CompLvlText prompt when player isn't in EndZone + CompLvlText.visible = false + # set the next level + LvlCompleteScreen.next_level = 1 # TODO change this to 2 + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + var player_pos = GeigerCounter.global_transform.origin + + var voxel_text = "" + var total_radiation = 0 + var index = 1 + # iterate through all sources + for source in sources: + var radiation = source.get_radiation(player_pos.x, player_pos.y, player_pos.z) + total_radiation += radiation[0] + + # add text for the voxel position the player is in + voxel_text += "\n%s. %s [%s, %s, %s] %s" % [index, source.name, radiation[1].x, \ + radiation[1].y, radiation[1].z, radiation[0]] + + # increment index + index += 1 + + accumulated_radiation += total_radiation * delta + + # set the label's text with total radiation and voxel positions + RadiationText.text = "Accumulated Radiation: %s\n" % accumulated_radiation + RadiationText.text += "Total Radiation: %s" % total_radiation + RadiationText.text += voxel_text + + # set value on GeigerCounter + Player.set_GeigerCounter_value(total_radiation) + + # set timeout on ClickTimer for the click sound + GC_ClickSound.set_radiation(total_radiation) + + # toggle whether current voxels in the MCNPMeshes are shown if v is pressed. + if Input.is_action_just_pressed("toggle_debug"): + for source in sources: + source.toggle_show_voxel() + + if !saw_cylinder: + if Global.camera_sees_object(PlayerCamera, Cylinder, [GlassWall]): + # make sure the objective cannot be completed more than once + saw_cylinder = true + # check off the objective + SeeCylinderObj.pressed = true + # show a notification for the objective that was completed + $ObjNotif.add_notification(SeeCylinderObj.text) + + # show LvlCompleteScreen if the player presses "f" in the EndZone + if CompLvlText.visible and Input.is_action_pressed("interact") and !lvl_complete: + # prevent this from happening more than once + lvl_complete = true + complete_level() + + +func complete_level(): + # remove PauseScreen to prevent player from pressing "esc" to open it + $PauseScreen.queue_free() + # prevent TabScreen from being opened + $TabScreen.lvl_complete = true + # reparent Objectives node as child of LvlCompleteScreen + var objectives = $InstObj1/VBoxContainer/Objectives1 + $InstObj1/VBoxContainer.remove_child(objectives) + LvlCompleteScreen.add_child(objectives) + # move objectives to a better position + objectives.rect_position = RadiationReceived.rect_position + objectives.rect_position.y += RadiationReceived.rect_size.y + 20 + # set the total radiation received + LvlCompleteScreen.set_RadiationReceived(accumulated_radiation) + + # pause the game + get_tree().paused = true + # let player move mouse + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + + # show the screen + LvlCompleteScreen.show() + + + +func _on_EndZone_body_entered(body): + if body == Player: + # show the CompLvlText prompt + CompLvlText.visible = true + if !reached_end_zone: + # make sure the objective cannot be completed more than once + reached_end_zone = true + # check off the objective + ReachEndZoneObj.pressed = true + # show a notification for the objective that was completed + $ObjNotif.add_notification(ReachEndZoneObj.text) + + +func _on_EndZone_body_exited(body): + if body == Player: + # hide the CompLvlText prompt + CompLvlText.visible = false diff --git a/scripts/LevelSelect.gd b/scripts/LevelSelect.gd new file mode 100644 index 0000000..accc1c8 --- /dev/null +++ b/scripts/LevelSelect.gd @@ -0,0 +1,10 @@ +extends Panel + +func _on_LevelButton1_pressed(): + Global.load_scene("res://scenes/Level1.tscn") + +func _on_LevelButton1_mouse_entered(): + $HBoxContainer/ColorRect/TextureRect1.visible = true + +func _on_LevelButton1_mouse_exited(): + $HBoxContainer/ColorRect/TextureRect1.visible = false diff --git a/scripts/LvlCompleteScreen.gd b/scripts/LvlCompleteScreen.gd new file mode 100644 index 0000000..388cf5c --- /dev/null +++ b/scripts/LvlCompleteScreen.gd @@ -0,0 +1,34 @@ +extends Panel + +var next_level # number of the next level + +# Called when the node enters the scene tree for the first time. +func _ready(): + # hide the level complete screen on startup + visible = false + $CanvasLayer.visible = false + modulate.a = 0 + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: + get_tree().quit() # default behavior to quit game + +func _on_LevelSelectButton_pressed(): + # change scene to Level Select scene + Global.go_to_scene("res://scenes/LevelSelect.tscn") + +func _on_QuitButton_pressed(): + # send notification to quit game + get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST) + +func _on_ContinueButton_pressed(): + # go to next level + Global.load_scene("res://scenes/Level%s.tscn" % next_level) + +func show(): + visible = true + $CanvasLayer.visible = true + $AnimationPlayer.play("FadeIn") + +func set_RadiationReceived(value): + $RadiationReceived/Number.text = "%f" % value diff --git a/scripts/MCNPMesh.gd b/scripts/MCNPMesh.gd index ec0588c..8b120fd 100644 --- a/scripts/MCNPMesh.gd +++ b/scripts/MCNPMesh.gd @@ -26,6 +26,9 @@ var y_is_up = true # bool for whether to show the current voxel mesh var show_voxel = false +# paths to nodes to improve performance +onready var CurrentVoxel = $CurrentVoxel + # Used to get the x,y,z boundaries of the voxels in the radiation map # units is the units of the boundaries. (Ex. if boundaries are in cm, units # would be 1/100) @@ -91,7 +94,7 @@ func initialize(csv_file_name, y_is_up_IN, units_IN): max_index = radiation_map.size() # hide the current voxel mesh on startup - $CurrentVoxel.visible = show_voxel + CurrentVoxel.visible = show_voxel # returns the index of the largest value in the array that is still smaller @@ -137,7 +140,7 @@ func get_radiation(x, y, z): # return early if any indices are -1 (indicates player is not in radiation map) if x_index == -1 or y_index == -1 or z_index == -1: - $CurrentVoxel.visible = false + CurrentVoxel.visible = false return [value, centroid] # calculate index of voxel that the player is in @@ -160,18 +163,18 @@ func get_radiation(x, y, z): # only update and show the voxel if we want it shown if index != prev_index and show_voxel: # set mesh's position to voxel's centroid - $CurrentVoxel.translation = centroid + CurrentVoxel.translation = centroid # set size of mesh - $CurrentVoxel.scale.x = bounds_x[x_index + 1] - bounds_x[x_index] - $CurrentVoxel.scale.y = bounds_y[y_index + 1] - bounds_y[y_index] - $CurrentVoxel.scale.z = bounds_z[z_index + 1] - bounds_z[z_index] + CurrentVoxel.scale.x = bounds_x[x_index + 1] - bounds_x[x_index] + CurrentVoxel.scale.y = bounds_y[y_index + 1] - bounds_y[y_index] + CurrentVoxel.scale.z = bounds_z[z_index + 1] - bounds_z[z_index] # update prev_index to latest index queried prev_index = index # show the mesh - $CurrentVoxel.visible = true + CurrentVoxel.visible = true # return an array with the radiation value and the voxel position return [value, centroid] @@ -179,4 +182,4 @@ func get_radiation(x, y, z): # toggles whether the current voxel mesh is shown or not func toggle_show_voxel(): show_voxel = !show_voxel - $CurrentVoxel.visible = show_voxel + CurrentVoxel.visible = show_voxel diff --git a/scripts/Main.gd b/scripts/Main.gd deleted file mode 100644 index 67dd61c..0000000 --- a/scripts/Main.gd +++ /dev/null @@ -1,49 +0,0 @@ -extends Node - -var sources # all the radioactive sources in the scene -var accumulated_radiation # total radiation accumulated over time - -# Called when the node enters the scene tree for the first time. -func _ready(): - sources = get_tree().get_nodes_in_group("sources") - accumulated_radiation = 0.0 - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta): - var player_pos = $Player/CameraJoint/Camera/GeigerCounter.global_transform.origin - - var voxel_text = "" - var total_radiation = 0 - var index = 1 - # iterate through all sources - for source in sources: - var radiation = source.get_radiation(player_pos.x, player_pos.y, player_pos.z) - total_radiation += radiation[0] - - # add text for the voxel position the player is in - voxel_text += "\n%s. %s [%s, %s, %s] %s" % [index, source.name, radiation[1].x, \ - radiation[1].y, radiation[1].z, radiation[0]] - - # increment index - index += 1 - - accumulated_radiation += total_radiation * delta - - # set the label's text with total radiation and voxel positions - $TabScreen/RadiationText.text = "Accumulated Radiation: %s\n" % accumulated_radiation - $TabScreen/RadiationText.text += "Total Radiation: %s" % total_radiation - $TabScreen/RadiationText.text += voxel_text - - # set value on GeigerCounter - $Player.set_GeigerCounter_value(total_radiation) - - # set timeout on ClickTimer for the click sound - $Player.GC_click_sound.set_radiation(total_radiation) - - # toggle whether current voxels in the MCNPMeshes are shown if v is pressed. - if Input.is_action_just_pressed("toggle_debug"): - for source in sources: - source.toggle_show_voxel() - - diff --git a/scripts/MainMenu.gd b/scripts/MainMenu.gd new file mode 100644 index 0000000..5cc4ed6 --- /dev/null +++ b/scripts/MainMenu.gd @@ -0,0 +1,21 @@ +extends Panel + +onready var animation = 0 + +func _process(delta): + if !$AnimationPlayer.is_playing(): + $AnimationPlayer.play("Move%s" % animation) + animation = (animation + 1) % 4 + + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: + get_tree().quit() # default behavior to quit game + +func _on_StartButton_pressed(): + # change scene to Level Select scene + Global.go_to_scene("res://scenes/LevelSelect.tscn") + +func _on_QuitButton_pressed(): + # send notification to quit game + get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST) diff --git a/scripts/ObjNotif.gd b/scripts/ObjNotif.gd new file mode 100644 index 0000000..45402a1 --- /dev/null +++ b/scripts/ObjNotif.gd @@ -0,0 +1,33 @@ +extends Panel + +# create an array as a queue for objectives +var objectives = [] +# only show a new notification if we aren't showing one now +onready var showing_notification = false + +func _ready(): + visible = false + modulate.a = 0 + +func _process(delta): + if objectives and !showing_notification: + show_notification(objectives.pop_front()) + +func add_notification(objective): + objectives.push_back(objective) + +func show_notification(objective): + showing_notification = true + visible = true + $Label.text = "Objective Complete: %s" % objective + # play the fade in and fade out animation + $AnimationPlayer.play("Fade") + # hide the notification after 3s + $Timer.start(3.0) + +func _on_Timer_timeout(): + # hide the notification + visible = false + # allow the next notification to be shown + showing_notification = false + diff --git a/scripts/PauseScreen.gd b/scripts/PauseScreen.gd new file mode 100644 index 0000000..0cb0086 --- /dev/null +++ b/scripts/PauseScreen.gd @@ -0,0 +1,34 @@ +extends Panel + +var show_pause # whether the pause screen is visible or not +var InstObj # reference to the InstObj of this level + +func _ready(): + show_pause = false + visible = false; + $CanvasLayer.visible = false + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: + get_tree().quit() # default behavior to quit game + +func _on_LevelSelectButton_pressed(): + # change scene to Level Select scene + Global.go_to_scene("res://scenes/LevelSelect.tscn") + +func _on_QuitButton_pressed(): + # send notification to quit game + get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST) + +func _unhandled_key_input(event): + if event.is_action_pressed("esc"): + # toggle whether the game is paused or not + show_pause = !show_pause + visible = show_pause + $CanvasLayer.visible = show_pause + InstObj.visible = show_pause + get_tree().paused = show_pause + if show_pause: + # let player move mouse (in case he is fully zoomed in) + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + diff --git a/scripts/Player.gd b/scripts/Player.gd index 8be7869..8c534d9 100644 --- a/scripts/Player.gd +++ b/scripts/Player.gd @@ -1,14 +1,11 @@ extends KinematicBody - export var speed = 2 var velocity = Vector3.ZERO -onready var GC_click_sound = $CameraJoint/Camera/GeigerCounter/ClickSound - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. +# paths to nodes to improve performance +onready var CameraJoint = $CameraJoint +onready var GC_ValueLabel = $CameraJoint/Camera/GeigerCounter/ValueLabel func _physics_process(delta): var direction = Vector3.ZERO @@ -25,15 +22,20 @@ func _physics_process(delta): direction += Vector3.UP if Input.is_action_pressed("move_down"): direction += Vector3.DOWN + # allow player to sprint by pressing shift + if Input.is_action_pressed("sprint"): + speed = 4 + else: + speed = 2 # change rotation of the player based on movement if direction != Vector3.ZERO: # rotate the direction of motion so it's relative to the camera's position - direction = direction.rotated(Vector3.UP, $CameraJoint.rotation.y).normalized() + direction = direction.rotated(Vector3.UP, CameraJoint.rotation.y).normalized() # make the player look in the direction of motion # this changes the model's orientation # only do this if we're not zoomed in (1st person mode) - if ($CameraJoint.spring_length != 0): + if (CameraJoint.spring_length != 0): var look_direction = Vector2(direction.z, direction.x) rotation.y = look_direction.angle() @@ -42,8 +44,8 @@ func _physics_process(delta): velocity = move_and_slide(velocity, Vector3.UP) # move the camera with the player - $CameraJoint.translation = translation + CameraJoint.translation = translation func set_GeigerCounter_value(value): - $CameraJoint/Camera/GeigerCounter/Sprite3D2/GeigerViewport/Label.text = "%.7f" % value + GC_ValueLabel.text = "%.7f" % value diff --git a/scripts/TabScreen.gd b/scripts/TabScreen.gd index 0a5a397..fa58cf2 100644 --- a/scripts/TabScreen.gd +++ b/scripts/TabScreen.gd @@ -1,9 +1,13 @@ extends Control +onready var lvl_complete = false + # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): - # if TAB is pressed, display the TabScreen - visible = Input.is_action_pressed("ui_focus_next") + # display the TabScreen when TAB is pressed, but only when we haven't + # completed the level + if !lvl_complete: + visible = Input.is_action_pressed("ui_focus_next") func set_RadiationText(text): $RadiationText.text = text diff --git a/text_theme.tres b/text_theme.tres new file mode 100644 index 0000000..72fcbe9 --- /dev/null +++ b/text_theme.tres @@ -0,0 +1,23 @@ +[gd_resource type="Theme" load_steps=5 format=2] + +[ext_resource path="res://fonts/TitilliumWeb/TitilliumWeb-Bold.ttf" type="DynamicFontData" id=1] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.337255, 0.0352941, 0.0352941, 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.596078, 0.101961, 0.101961, 1 ) + +[sub_resource type="DynamicFont" id=3] +size = 37 +font_data = ExtResource( 1 ) + +[resource] +default_font = SubResource( 3 ) +Button/colors/font_color = Color( 1, 1, 1, 1 ) +Button/colors/font_color_disabled = Color( 1, 1, 1, 1 ) +Button/colors/font_color_focus = Color( 1, 1, 1, 1 ) +Button/colors/font_color_hover = Color( 0.580392, 0.580392, 0.580392, 1 ) +Button/colors/font_color_pressed = Color( 0.364706, 0.364706, 0.364706, 1 ) +Button/styles/hover = SubResource( 1 ) +Button/styles/normal = SubResource( 2 )