diff --git a/Assets/crosshair.png b/Assets/crosshair.png new file mode 100644 index 0000000..12e320f Binary files /dev/null and b/Assets/crosshair.png differ diff --git a/Assets/crosshair.png.import b/Assets/crosshair.png.import new file mode 100644 index 0000000..354418e --- /dev/null +++ b/Assets/crosshair.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://buafet16thf3p" +path="res://.godot/imported/crosshair.png-7bed3294e640fe9ca357247b0602b756.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/crosshair.png" +dest_files=["res://.godot/imported/crosshair.png-7bed3294e640fe9ca357247b0602b756.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Levels/StartingRoom.tscn b/Levels/StartingRoom.tscn new file mode 100644 index 0000000..ed869e2 --- /dev/null +++ b/Levels/StartingRoom.tscn @@ -0,0 +1,68 @@ +[gd_scene load_steps=13 format=3 uid="uid://bojbawyoy11i4"] + +[ext_resource type="Script" path="res://Scripts/ChronoManager.gd" id="1_5b2rd"] +[ext_resource type="Material" uid="uid://cr4ra7ijk1uec" path="res://Assets/Materials/floor.tres" id="2_0aj3l"] +[ext_resource type="PackedScene" uid="uid://d34smep2ukq7w" path="res://player.tscn" id="2_hsi55"] +[ext_resource type="PackedScene" uid="uid://bnlexkofp68gv" path="res://gui.tscn" id="3_60lfp"] + +[sub_resource type="BoxMesh" id="BoxMesh_21vdj"] +material = ExtResource("2_0aj3l") + +[sub_resource type="BoxShape3D" id="BoxShape3D_nndy8"] + +[sub_resource type="MeshLibrary" id="MeshLibrary_udrkc"] +item/0/name = "dsa" +item/0/mesh = SubResource("BoxMesh_21vdj") +item/0/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/0/shapes = [SubResource("BoxShape3D_nndy8"), Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)] +item/0/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/0/navigation_layers = 1 + +[sub_resource type="Environment" id="Environment_u27ip"] +background_mode = 1 +background_color = Color(1, 1, 1, 1) +ambient_light_energy = 0.5 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_itc1d"] +albedo_color = Color(0.571354, 1, 0.475134, 1) + +[sub_resource type="BoxMesh" id="BoxMesh_lcav8"] +material = SubResource("StandardMaterial3D_itc1d") + +[sub_resource type="BoxShape3D" id="BoxShape3D_y4l56"] + +[sub_resource type="BoxMesh" id="BoxMesh_u6v2s"] +size = Vector3(1, 2, 1) + +[node name="ChronoManager" type="Node3D"] +script = ExtResource("1_5b2rd") + +[node name="Player" parent="." instance=ExtResource("2_hsi55")] + +[node name="GridMap" type="GridMap" parent="."] +mesh_library = SubResource("MeshLibrary_udrkc") +cell_size = Vector3(1, 1, 1) +data = { +"cells": PackedInt32Array(65533, 65534, 851968, 65532, 65534, 851968, 65533, 65533, 851968, 65532, 65533, 851968, 65534, 65531, 851968, 65533, 65531, 851968, 65532, 65531, 851968, 65531, 65531, 851968, 65530, 65531, 851968, 65529, 65531, 851968, 65532, 65526, 851968, 65531, 65526, 851968, 65530, 65526, 851968, 65529, 65526, 851968, 65528, 65526, 851968, 65527, 65526, 851968, 65526, 65526, 851968, 65525, 65526, 851968, 65526, 65525, 851968, 65527, 65525, 851968, 65528, 65525, 851968, 65529, 65525, 851968, 65530, 65525, 851968, 65531, 65525, 851968, 65532, 65525, 851968, 65533, 65525, 851968, 65525, 65525, 851968, 65524, 65525, 851968, 65524, 65526, 851968, 65523, 65525, 851968, 65523, 65526, 851968, 65522, 65527, 851968, 65523, 65527, 851968, 65523, 65528, 851968, 65523, 65529, 851968, 65523, 65530, 851968, 65523, 65531, 851968, 65523, 65532, 851968, 196595, 65525, 851968, 196596, 65525, 851968, 196597, 65525, 851968, 196598, 65525, 851968, 196599, 65525, 851968, 196600, 65525, 851968, 196601, 65525, 851968, 196602, 65525, 851968, 196603, 65525, 851968, 196604, 65525, 851968, 196605, 65526, 851968, 196604, 65526, 851968, 196603, 65526, 851968, 196602, 65526, 851968, 196601, 65526, 851968, 196600, 65526, 851968, 196599, 65526, 851968, 196598, 65526, 851968, 196597, 65526, 851968, 196596, 65526, 851968, 196595, 65526, 851968, 196594, 65526, 851968, 131059, 65526, 851968, 131060, 65526, 851968, 131061, 65526, 851968, 131062, 65526, 851968, 131062, 65527, 851968, 131063, 65527, 851968, 131064, 65527, 851968, 131065, 65527, 851968, 131066, 65527, 851968, 131066, 65526, 851968, 131067, 65526, 851968, 131068, 65526, 851968, 131065, 65526, 851968, 131064, 65526, 851968, 131063, 65526, 851968, 131064, 3, 851968, 131063, 3, 851968, 131062, 3, 851968, 131062, 4, 851968, 131063, 4, 851968, 131063, 5, 786432, 131064, 5, 786432, 131065, 5, 786432, 131065, 4, 983040, 131064, 4, 851968, 131068, 8, 851968, 131063, 9, 786432, 131056, 0, 786432, 131059, 5, 786432, 131058, 5, 786432, 131057, 5, 786432, 131056, 5, 786432, 131056, 4, 786432, 131055, 4, 786432, 131055, 3, 786432, 131055, 2, 786432, 131056, 2, 786432, 131056, 1, 786432, -65550, 0, 786432, -65549, 0, 786432, -13, 0, 786432, -12, 0, 786432, 65524, 0, 786432, 65523, 0, 786432, 131059, 0, 786432, 131058, 0, 786432, 65522, 0, 786432, -14, 0, 786432, 65521, 0, 786432, -15, 0, 786432, 196594, 0, 786432, 196593, 0, 786432, 131057, 0, 786432, 65520, 0, 786432, -16, 0, 786432, -65551, 0, 786432, -131087, 0, 786432, -196623, 0, 786432, -196622, 0, 786432, -131086, 0, 786432, 262130, 0, 786432, 262129, 0, 786432, 327665, 0, 786432, 262128, 0, 786432, 196592, 0, 786432, -196621, 0, 786432, -131085, 0, 786432, -65548, 0, 786432, 196595, 0, 786432, -262158, 0, 786432, -262157, 0, 786432, -131084, 0, 786432, -65547, 0, 786432, -11, 0, 786432, 65525, 0, 786432, 131061, 0, 786432, 196597, 0, 786432, 196596, 0, 786432, 262132, 0, 786432, 327667, 0, 786432, 393203, 0, 786432, 393202, 0, 786432, 393201, 0, 786432, 327664, 0, 786432, 131055, 0, 786432, 65519, 0, 786432, -17, 0, 786432, -65552, 0, 786432, -131088, 0, 786432, -262160, 0, 786432, -327694, 0, 786432, -327693, 0, 786432, -262156, 0, 786432, -196620, 0, 786432, 131060, 0, 786432, 262131, 0, 786432, 327666, 0, 786432, -65553, 0, 786432, -131089, 0, 786432, -196625, 0, 786432, -196624, 0, 786432, -262159, 0, 786432, -327695, 0, 786432, 131062, 5, 786432, 131062, 6, 786432, 131062, 7, 786432, 131062, 8, 786432, 131062, 9, 786432, 131063, 6, 786432, 131063, 7, 786432, 131063, 8, 786432, 131064, 6, 786432, 131064, 7, 786432, 131064, 8, 786432, 131064, 9, 786432, 131065, 6, 786432, 131065, 7, 786432, 131065, 8, 786432, 131065, 9, 786432, 131066, 5, 786432, 131066, 6, 786432, 131066, 7, 786432, 131066, 8, 786432, 131066, 9, 786432, 131067, 5, 983040, 131067, 6, 786432, 131067, 7, 786432, 131067, 8, 786432, 131067, 9, 786432, 131065, 3, 983040, 131066, 4, 983040, 131068, 5, 983040, 131068, 6, 983040, 131067, 4, 983040, 131066, 3, 983040, 131066, 2, 983040, 131065, 2, 983040, 131067, 3, 983040, 131069, 6, 983040, 131069, 5, 983040, 131068, 4, 983040, 131067, 2, 983040, 131066, 1, 983040, 131068, 3, 983040, 131069, 4, 983040, 131070, 5, 983040, 131070, 6, 983040, 131068, 2, 983040, 131070, 4, 983040, 131071, 5, 983040, 131069, 3, 983040, 131068, 1, 983040, 131069, 1, 983040, 131070, 2, 983040, 131070, 3, 983040, 131071, 3, 983040, 131069, 2, 983040, 131068, 0, 983040, 65536, 5, 983040, 131071, 4, 983040, 65536, 4, 983040, 131070, 1, 983040, 131071, 2, 983040, 65536, 3, 983040, 65534, 0, 983040, 65534, 1, 983040, 65535, 1, 983040, 0, 1, 983040, 65533, 0, 983040, 65535, 0, 983040, 0, 0, 983040, 1, 0, 983040, 1, 1, 983040, 2, 1, 983040, 65533, 65535, 983040, 65532, 65535, 983040, 65534, 65535, 983040, 65535, 65535, 983040, 2, 0, 983040, 0, 65535, 983040, 65534, 65534, 983040, 65535, 65534, 983040, 1, 65535, 983040, 2, 65535, 983040, 0, 65534, 983040, 1, 65534, 983040, 65535, 65533, 983040, 65534, 65533, 983040, 0, 65533, 983040, 2, 65534, 983040, 1, 65533, 983040, 65527, 16, 393216, 65528, 16, 393216, 65529, 16, 393216, 65530, 16, 393216, 65531, 17, 393216, 65531, 18, 393216, 65531, 19, 393216, 65531, 20, 393216, 65530, 21, 393216, 65529, 21, 393216, 1, 16, 393216, 2, 17, 393216, 2, 18, 393216, 2, 19, 393216, 1, 20, 393216, 0, 20, 393216, 65535, 20, 393216, 65534, 19, 393216, 65534, 18, 393216, 65528, 21, 393216, 65527, 21, 393216, 65526, 20, 393216, 65526, 19, 393216, 65526, 17, 393216, 65526, 18, 393216, 65534, 17, 393216, 65535, 16, 393216) +} +metadata/_editor_floor_ = Vector3(0, 0, 0) + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_u27ip") + +[node name="Gui" parent="." instance=ExtResource("3_60lfp")] + +[node name="EndZone" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.3626, 2.6528, 7.56273) +mesh = SubResource("BoxMesh_lcav8") + +[node name="Area3D" type="Area3D" parent="EndZone"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="EndZone/Area3D"] +shape = SubResource("BoxShape3D_y4l56") + +[node name="Terminal" type="Node3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.50596, 2.93638, 3.58967) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Terminal"] +mesh = SubResource("BoxMesh_u6v2s") diff --git a/Levels/TestZone.tscn b/Levels/TestZone.tscn deleted file mode 100644 index 3006444..0000000 --- a/Levels/TestZone.tscn +++ /dev/null @@ -1,277 +0,0 @@ -[gd_scene load_steps=12 format=3 uid="uid://bojbawyoy11i4"] - -[ext_resource type="Script" path="res://Scripts/Player.gd" id="2_0sf88"] -[ext_resource type="Material" uid="uid://cr4ra7ijk1uec" path="res://Assets/Materials/floor.tres" id="2_8fy0v"] - -[sub_resource type="Shader" id="Shader_gv186"] -code = "shader_type spatial; - -#define USE_ALPHA 0 -#define USE_ALPHA_CUTOFF 0 -#define USE_EMISSION 0 -#define USE_REFLECTIONS 0 -#define USE_NORMAL_MAP 0 -#define USE_OCCLUSION 0 -#define USE_ANISOTROPY 0 -#define USE_BACKLIGHT 0 -#define USE_REFRACTION 0 - -#if USE_ALPHA -render_mode depth_draw_always; -#endif - -#include \"includes/base-cel-shader.gdshaderinc\" - -#if USE_EMISSION -#include \"includes/emission.gdshaderinc\" -#endif - -#if USE_REFLECTIONS -#include \"includes/reflections.gdshaderinc\" -#endif - -#if USE_NORMAL_MAP -#include \"includes/normal-map.gdshaderinc\" -#endif - -#if USE_OCCLUSION -#include \"includes/occlusion.gdshaderinc\" -#endif - -#if USE_ANISOTROPY -#include \"includes/anisotropy.gdshaderinc\" -#endif - -#if USE_BACKLIGHT -#include \"includes/backlight.gdshaderinc\" -#endif - -#if USE_REFRACTION -#include \"includes/refraction.gdshaderinc\" -#elif !USE_REFRACTION && USE_ALPHA -#include \"includes/transparency.gdshaderinc\" -#endif - -group_uniforms BaseProperties; -#if USE_ALPHA_CUTOFF -uniform float alpha_cutoff: hint_range(0.0, 1.0) = 0.5; -#endif -uniform vec4 color: source_color = vec4(0.7, 0.12, 0.86, 1.0); -uniform sampler2D base_texture: source_color; -uniform vec4 specular: source_color = vec4(0.3, 0.3, 0.3, 0.5); -uniform sampler2D specular_texture: hint_default_white; -uniform vec4 fresnel: source_color = vec4(0.2, 0.2, 0.2, 0.3); -uniform sampler2D fresnel_texture: hint_default_white; -group_uniforms; - -varying vec3 SPECULAR_COLOR; -varying float SPECULAR_STRENGTH; -varying vec3 FRESNEL_COLOR; -varying float FRESNEL_STRENGTH; - -group_uniforms Tiling; -uniform vec2 uv_scale = vec2(1,1); -uniform vec2 uv_offset = vec2(0,0); -group_uniforms; - - -void vertex() { - UV = UV * uv_scale.xy + uv_offset.xy; -} - -void fragment() { - ALBEDO = color.rgb * texture(base_texture, UV).rgb; -#if USE_ALPHA - float alpha = color.a * texture(base_texture, UV).a; - ALBEDO *= alpha; -#elif USE_ALPHA_CUTOFF - ALPHA = color.a * texture(base_texture, UV).a; - ALPHA_SCISSOR_THRESHOLD = color.a * texture(base_texture, UV).a; -#endif - -#if USE_REFRACTION && USE_ALPHA - EMISSION += refraction_fragment(alpha, NORMAL, SCREEN_UV, FRAGCOORD.z); -#elif !USE_REFRACTION && USE_ALPHA - EMISSION += transparency_fragment(alpha, SCREEN_UV); -#endif - - SPECULAR_COLOR = specular.rgb * texture(specular_texture, UV).rgb; - SPECULAR_STRENGTH = specular.a * texture(specular_texture, UV).a; - FRESNEL_COLOR = fresnel.rgb * texture(fresnel_texture, UV).rgb; - FRESNEL_STRENGTH = fresnel.a * texture(fresnel_texture, UV).a; - -#if USE_EMISSION - EMISSION += emission_fragment(UV); -#endif - -#if USE_REFLECTIONS - Surface surf = reflections_fragment(UV); - METALLIC = surf.metallic; - ROUGHNESS = surf.roughness; -#endif - -#if USE_NORMAL_MAP - NormalData normal = normal_map_fragment(UV, NORMAL, TANGENT, BINORMAL); - NORMAL = normal.vector; - NORMAL_MAP = normal.map; - NORMAL_MAP_DEPTH = normal.depth; -#endif - -#if USE_OCCLUSION - OcclusionData occlusion = occlusion_fragment(UV); - AO = occlusion.ao; - AO_LIGHT_AFFECT = occlusion.ao_light_affect; -#endif - -#if USE_ANISOTROPY - AnisotropyData aniso = anisotropy_fragment(UV); - ANISOTROPY_DIR = aniso.direction; - ANISOTROPY_RATIO = aniso.ratio; -#endif - -#if USE_BACKLIGHT - BACKLIGHT = backlight_fragment(UV); -#endif -} - -void light() { -#if USE_BACKLIGHT - DIFFUSE_LIGHT += backlight_diffuse( - ALBEDO, - LIGHT_COLOR, - LIGHT, - NORMAL, - ATTENUATION, - BACKLIGHT - ); -#else - DIFFUSE_LIGHT += diffuse_light( - ALBEDO, - LIGHT_COLOR, - LIGHT, - NORMAL, - ATTENUATION - ); -#endif - -#if USE_ANISOTROPY - SPECULAR_LIGHT += anisotropy_specular( - LIGHT_COLOR, - SPECULAR_COLOR, - SPECULAR_STRENGTH, - NORMAL, - VIEW, - LIGHT, - ATTENUATION, - UV, - ANISOTROPY_DIR, - ANISOTROPY_RATIO - ); -#else - SPECULAR_LIGHT += specular_light( - LIGHT_COLOR, - SPECULAR_COLOR, - SPECULAR_STRENGTH, - NORMAL, - VIEW, - LIGHT, - ATTENUATION - ); -#endif - - SPECULAR_LIGHT += fresnel_light( - LIGHT_COLOR, - FRESNEL_COLOR, - FRESNEL_STRENGTH, - NORMAL, - VIEW, - LIGHT, - ATTENUATION - ); -} -" - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_0th4j"] -render_priority = 0 -shader = SubResource("Shader_gv186") -shader_parameter/color = Color(1, 1, 1, 1) -shader_parameter/specular = Color(0.3, 0.3, 0.3, 0.5) -shader_parameter/fresnel = Color(0.2, 0.2, 0.2, 0.3) -shader_parameter/uv_scale = Vector2(1, 1) -shader_parameter/uv_offset = Vector2(0, 0) - -[sub_resource type="BoxMesh" id="BoxMesh_67chd"] -material = SubResource("ShaderMaterial_0th4j") -size = Vector3(10, 1, 10) - -[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_drsh3"] -data = PackedVector3Array(-5, 0.5, 5, 5, 0.5, 5, -5, -0.5, 5, 5, 0.5, 5, 5, -0.5, 5, -5, -0.5, 5, 5, 0.5, -5, -5, 0.5, -5, 5, -0.5, -5, -5, 0.5, -5, -5, -0.5, -5, 5, -0.5, -5, 5, 0.5, 5, 5, 0.5, -5, 5, -0.5, 5, 5, 0.5, -5, 5, -0.5, -5, 5, -0.5, 5, -5, 0.5, -5, -5, 0.5, 5, -5, -0.5, -5, -5, 0.5, 5, -5, -0.5, 5, -5, -0.5, -5, 5, 0.5, 5, -5, 0.5, 5, 5, 0.5, -5, -5, 0.5, 5, -5, 0.5, -5, 5, 0.5, -5, -5, -0.5, 5, 5, -0.5, 5, -5, -0.5, -5, 5, -0.5, 5, 5, -0.5, -5, -5, -0.5, -5) - -[sub_resource type="CapsuleMesh" id="CapsuleMesh_5q2rg"] - -[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_a6eig"] - -[sub_resource type="BoxMesh" id="BoxMesh_21vdj"] -material = ExtResource("2_8fy0v") - -[sub_resource type="BoxShape3D" id="BoxShape3D_nndy8"] - -[sub_resource type="MeshLibrary" id="MeshLibrary_udrkc"] -item/0/name = "dsa" -item/0/mesh = SubResource("BoxMesh_21vdj") -item/0/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) -item/0/shapes = [SubResource("BoxShape3D_nndy8"), Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)] -item/0/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) -item/0/navigation_layers = 1 - -[node name="TestZone" type="Node3D"] - -[node name="MeshInstance3D" type="MeshInstance3D" parent="."] -process_mode = 4 -visible = false -mesh = SubResource("BoxMesh_67chd") - -[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"] - -[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"] -shape = SubResource("ConcavePolygonShape3D_drsh3") - -[node name="MeshInstance3D2" type="MeshInstance3D" parent="."] -process_mode = 4 -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.95936, 0.687725, -3.34325) -visible = false -mesh = SubResource("BoxMesh_67chd") - -[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D2"] - -[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D2/StaticBody3D"] -shape = SubResource("ConcavePolygonShape3D_drsh3") - -[node name="Player" type="CharacterBody3D" parent="." node_paths=PackedStringArray("camera")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0) -script = ExtResource("2_0sf88") -camera = NodePath("Camera3D") - -[node name="MeshInstance3D2" type="MeshInstance3D" parent="Player"] -mesh = SubResource("CapsuleMesh_5q2rg") -skeleton = NodePath("../..") - -[node name="Camera3D" type="Camera3D" parent="Player"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.621505, 0) - -[node name="CollisionShape3D" type="CollisionShape3D" parent="Player"] -shape = SubResource("CapsuleShape3D_a6eig") - -[node name="OmniLight3D" type="OmniLight3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.94042, 0) -light_color = Color(0.69761, 0.418962, 0.0472636, 1) -omni_range = 15.748 -omni_attenuation = 0.210224 - -[node name="GridMap" type="GridMap" parent="."] -mesh_library = SubResource("MeshLibrary_udrkc") -cell_size = Vector3(1, 1, 1) -data = { -"cells": PackedInt32Array(65533, 65534, 851968, 65532, 65534, 851968, 65533, 65533, 851968, 65532, 65533, 851968, 65534, 65531, 851968, 65533, 65531, 851968, 65532, 65531, 851968, 65531, 65531, 851968, 65530, 65531, 851968, 65529, 65531, 851968, 65532, 65526, 851968, 65531, 65526, 851968, 65530, 65526, 851968, 65529, 65526, 851968, 65528, 65526, 851968, 65527, 65526, 851968, 65526, 65526, 851968, 65525, 65526, 851968, 65526, 65525, 851968, 65527, 65525, 851968, 65528, 65525, 851968, 65529, 65525, 851968, 65530, 65525, 851968, 65531, 65525, 851968, 65532, 65525, 851968, 65533, 65525, 851968, 65525, 65525, 851968, 65524, 65525, 851968, 65524, 65526, 851968, 65523, 65525, 851968, 65523, 65526, 851968, 65522, 65527, 851968, 65523, 65527, 851968, 65523, 65528, 851968, 65523, 65529, 851968, 65523, 65530, 851968, 65523, 65531, 851968, 65523, 65532, 851968, 196595, 65525, 851968, 196596, 65525, 851968, 196597, 65525, 851968, 196598, 65525, 851968, 196599, 65525, 851968, 196600, 65525, 851968, 196601, 65525, 851968, 196602, 65525, 851968, 196603, 65525, 851968, 196604, 65525, 851968, 196605, 65526, 851968, 196604, 65526, 851968, 196603, 65526, 851968, 196602, 65526, 851968, 196601, 65526, 851968, 196600, 65526, 851968, 196599, 65526, 851968, 196598, 65526, 851968, 196597, 65526, 851968, 196596, 65526, 851968, 196595, 65526, 851968, 196594, 65526, 851968, 131059, 65526, 851968, 131060, 65526, 851968, 131061, 65526, 851968, 131062, 65526, 851968, 131062, 65527, 851968, 131063, 65527, 851968, 131064, 65527, 851968, 131065, 65527, 851968, 131066, 65527, 851968, 131066, 65526, 851968, 131067, 65526, 851968, 131068, 65526, 851968, 131065, 65526, 851968, 131064, 65526, 851968, 131063, 65526, 851968, 131064, 3, 851968, 131063, 3, 851968, 131062, 3, 851968, 131062, 4, 851968, 131063, 4, 851968, 131063, 5, 786432, 131064, 5, 786432, 131065, 5, 786432, 131065, 4, 983040, 131064, 4, 851968, 131068, 8, 851968, 131063, 9, 786432, 131056, 0, 786432, 131059, 5, 786432, 131058, 5, 786432, 131057, 5, 786432, 131056, 5, 786432, 131056, 4, 786432, 131055, 4, 786432, 131055, 3, 786432, 131055, 2, 786432, 131056, 2, 786432, 131056, 1, 786432, -65550, 0, 786432, -65549, 0, 786432, -13, 0, 786432, -12, 0, 786432, 65524, 0, 786432, 65523, 0, 786432, 131059, 0, 786432, 131058, 0, 786432, 65522, 0, 786432, -14, 0, 786432, 65521, 0, 786432, -15, 0, 786432, 196594, 0, 786432, 196593, 0, 786432, 131057, 0, 786432, 65520, 0, 786432, -16, 0, 786432, -65551, 0, 786432, -131087, 0, 786432, -196623, 0, 786432, -196622, 0, 786432, -131086, 0, 786432, 262130, 0, 786432, 262129, 0, 786432, 327665, 0, 786432, 262128, 0, 786432, 196592, 0, 786432, -196621, 0, 786432, -131085, 0, 786432, -65548, 0, 786432, 196595, 0, 786432, -262158, 0, 786432, -262157, 0, 786432, -131084, 0, 786432, -65547, 0, 786432, -11, 0, 786432, 65525, 0, 786432, 131061, 0, 786432, 196597, 0, 786432, 196596, 0, 786432, 262132, 0, 786432, 327667, 0, 786432, 393203, 0, 786432, 393202, 0, 786432, 393201, 0, 786432, 327664, 0, 786432, 131055, 0, 786432, 65519, 0, 786432, -17, 0, 786432, -65552, 0, 786432, -131088, 0, 786432, -262160, 0, 786432, -327694, 0, 786432, -327693, 0, 786432, -262156, 0, 786432, -196620, 0, 786432, 131060, 0, 786432, 262131, 0, 786432, 327666, 0, 786432, -65553, 0, 786432, -131089, 0, 786432, -196625, 0, 786432, -196624, 0, 786432, -262159, 0, 786432, -327695, 0, 786432, 131062, 5, 786432, 131062, 6, 786432, 131062, 7, 786432, 131062, 8, 786432, 131062, 9, 786432, 131063, 6, 786432, 131063, 7, 786432, 131063, 8, 786432, 131064, 6, 786432, 131064, 7, 786432, 131064, 8, 786432, 131064, 9, 786432, 131065, 6, 786432, 131065, 7, 786432, 131065, 8, 786432, 131065, 9, 786432, 131066, 5, 786432, 131066, 6, 786432, 131066, 7, 786432, 131066, 8, 786432, 131066, 9, 786432, 131067, 5, 983040, 131067, 6, 786432, 131067, 7, 786432, 131067, 8, 786432, 131067, 9, 786432, 131065, 3, 983040, 131066, 4, 983040, 131068, 5, 983040, 131068, 6, 983040, 131067, 4, 983040, 131066, 3, 983040, 131066, 2, 983040, 131065, 2, 983040, 131067, 3, 983040, 131069, 6, 983040, 131069, 5, 983040, 131068, 4, 983040, 131067, 2, 983040, 131066, 1, 983040, 131068, 3, 983040, 131069, 4, 983040, 131070, 5, 983040, 131070, 6, 983040, 131068, 2, 983040, 131070, 4, 983040, 131071, 5, 983040, 131069, 3, 983040, 131068, 1, 983040, 131069, 1, 983040, 131070, 2, 983040, 131070, 3, 983040, 131071, 3, 983040, 131069, 2, 983040, 131068, 0, 983040, 65536, 5, 983040, 131071, 4, 983040, 65536, 4, 983040, 131070, 1, 983040, 131071, 2, 983040, 65536, 3, 983040, 65534, 0, 983040, 65534, 1, 983040, 65535, 1, 983040, 0, 1, 983040, 65533, 0, 983040, 65535, 0, 983040, 0, 0, 983040, 1, 0, 983040, 1, 1, 983040, 2, 1, 983040, 65533, 65535, 983040, 65532, 65535, 983040, 65534, 65535, 983040, 65535, 65535, 983040, 2, 0, 983040, 0, 65535, 983040, 65534, 65534, 983040, 65535, 65534, 983040, 1, 65535, 983040, 2, 65535, 983040, 0, 65534, 983040, 1, 65534, 983040, 65535, 65533, 983040, 65534, 65533, 983040, 0, 65533, 983040, 2, 65534, 983040, 1, 65533, 983040) -} -metadata/_editor_floor_ = Vector3(0, 0, 0) diff --git a/Scripts/ChronoManager.gd b/Scripts/ChronoManager.gd new file mode 100644 index 0000000..1a1ec5c --- /dev/null +++ b/Scripts/ChronoManager.gd @@ -0,0 +1,46 @@ +extends Node3D +# this is basically the level manager + +signal broadcast(command : String) + +@export_group("Variables") +@export var level_tick : float = 1 # how often to run a command +@export var level_time : float = 10 # the amoutn of time allowed for the level +@export var commands : Array[String] +@export_group("Node References") +@export var gui : Control + +# Called when the node enters the scene tree for the first time. +func _ready(): + while(commands.size() < level_time / level_tick): # prevent index out of bounds error + commands.append("") + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func set_command(position : int, command : String): + commands[position] = command + +func start_room(): + # open door + # start timers + # start running commands + #hide crosshair + pass + +func reset_room(): + # run if timer expires, resets puzzle + pass + +func finish_room(): + # called when player reaches exit + pass + +func open_termimal(): + gui.terminal_panel.visible = true + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + #display terminal ui + pass diff --git a/Scripts/Player.gd b/Scripts/Player.gd index db577ce..3922d0f 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -2,6 +2,7 @@ extends CharacterBody3D @export var camera : Camera3D @export var mouse_sensitivity : float = 0.003 # TODO: this is sketchy check that its framerate independant pls +@export var raycast : RayCast3D const SPEED = 5.0 const JUMP_VELOCITY = 4.5 @@ -27,6 +28,10 @@ func _physics_process(delta): Input.mouse_mode = Input.MOUSE_MODE_VISIBLE else: Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + + # interact with stuff + if Input.is_action_just_pressed("interact"): + print(raycast.) # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. diff --git a/Scripts/gui.gd b/Scripts/gui.gd new file mode 100644 index 0000000..b95ec59 --- /dev/null +++ b/Scripts/gui.gd @@ -0,0 +1,17 @@ +extends Control + +@export_group("Node References") +@export var terminal_panel : Control + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func close_terminal(): + terminal_panel.visible = false + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED diff --git a/gui.tscn b/gui.tscn new file mode 100644 index 0000000..bf965bd --- /dev/null +++ b/gui.tscn @@ -0,0 +1,79 @@ +[gd_scene load_steps=4 format=3 uid="uid://bnlexkofp68gv"] + +[ext_resource type="Script" path="res://Scripts/gui.gd" id="1_7s0l7"] +[ext_resource type="Texture2D" uid="uid://buafet16thf3p" path="res://Assets/crosshair.png" id="1_mpwvh"] + +[sub_resource type="LabelSettings" id="LabelSettings_lrnc3"] +font_color = Color(1, 0, 0, 1) + +[node name="Gui" type="Control" node_paths=PackedStringArray("terminal_panel")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_7s0l7") +terminal_panel = NodePath("Terminal") + +[node name="Label" type="Label" parent="."] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 23.0 +text = "Time: 10" +label_settings = SubResource("LabelSettings_lrnc3") + +[node name="Crosshair" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="TextureRect" type="TextureRect" parent="Crosshair"] +modulate = Color(1, 1, 1, 0.486275) +custom_minimum_size = Vector2(10, 10) +layout_mode = 2 +texture = ExtResource("1_mpwvh") +expand_mode = 1 + +[node name="Terminal" type="Control" parent="."] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="Terminal"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 200 +theme_override_constants/margin_top = 75 +theme_override_constants/margin_right = 200 +theme_override_constants/margin_bottom = 75 + +[node name="PanelContainer" type="PanelContainer" parent="Terminal/MarginContainer"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Terminal/MarginContainer/PanelContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Terminal/MarginContainer/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Terminal UI" +horizontal_alignment = 1 + +[node name="CloseButton" type="Button" parent="Terminal/MarginContainer/PanelContainer"] +layout_mode = 2 +size_flags_horizontal = 8 +size_flags_vertical = 0 +text = "X" + +[connection signal="pressed" from="Terminal/MarginContainer/PanelContainer/CloseButton" to="." method="close_terminal"] diff --git a/player.tscn b/player.tscn new file mode 100644 index 0000000..0799cc8 --- /dev/null +++ b/player.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=4 format=3 uid="uid://d34smep2ukq7w"] + +[ext_resource type="Script" path="res://Scripts/Player.gd" id="1_tc5d2"] + +[sub_resource type="CapsuleMesh" id="CapsuleMesh_5q2rg"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_a6eig"] + +[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0) +script = ExtResource("1_tc5d2") +camera = NodePath("Camera3D") +mouse_sensitivity = null +raycast = NodePath("Camera3D/RayCast3D") + +[node name="MeshInstance3D2" type="MeshInstance3D" parent="."] +mesh = SubResource("CapsuleMesh_5q2rg") +skeleton = NodePath("../..") + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.621505, 0) + +[node name="RayCast3D" type="RayCast3D" parent="Camera3D"] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0) +target_position = Vector3(0, -4, 0) + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("CapsuleShape3D_a6eig") diff --git a/project.godot b/project.godot index 517bd98..4eea4d4 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="Chrono Chamber" -run/main_scene="res://Levels/TestZone.tscn" +run/main_scene="res://Levels/StartingRoom.tscn" config/features=PackedStringArray("4.2", "Forward Plus") config/icon="res://icon.svg" @@ -47,6 +47,11 @@ esc={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null) ] } +interact={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) +] +} [rendering]