ggj2020

My game project for Global Game Jam 2020!
git clone git://git.hellocld.com/ggj2020
Log | Files | Refs

commit ffbc50b9482c8a3aed8efd6220a544d66bc47f76
parent cc249bcb23b0670ed2c19c1987c612d05dafb851
Author: Christopher Ray Langford <chris@hellocld.com>
Date:   Sun,  2 Feb 2020 11:21:42 -0500

Starting work with CSGs and level prototyping

Diffstat:
A.import/TestTile01.png-67d7ee87536d115e689590587e15689e.etc.stex | 0
A.import/TestTile01.png-67d7ee87536d115e689590587e15689e.md5 | 3+++
A.import/TestTile01.png-67d7ee87536d115e689590587e15689e.s3tc.stex | 0
A.import/TestTile01.png-67d7ee87536d115e689590587e15689e.stex | 0
AConfigureVR.gd | 9+++++++++
ARayCast.gd | 5+++++
MSpatial.tscn | 11+++--------
AWorlds/CSG_Testing/CSG VR Test.tscn | 22++++++++++++++++++++++
AWorlds/CSG_Testing/CSG_tut.tscn | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorlds/CSG_Testing/TestTile01.png | 0
AWorlds/CSG_Testing/TestTile01.png.import | 34++++++++++++++++++++++++++++++++++
Mproject.godot | 4++++
12 files changed, 154 insertions(+), 8 deletions(-)

diff --git a/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.etc.stex b/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.etc.stex Binary files differ. diff --git a/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.md5 b/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.md5 @@ -0,0 +1,3 @@ +source_md5="56c9c445eaf5f9f19a968670dae06117" +dest_md5="3dece7106d327a2da07c93f414731251" + diff --git a/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.s3tc.stex b/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.s3tc.stex Binary files differ. diff --git a/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.stex b/.import/TestTile01.png-67d7ee87536d115e689590587e15689e.stex Binary files differ. diff --git a/ConfigureVR.gd b/ConfigureVR.gd @@ -0,0 +1,9 @@ +extends Spatial + + +func _ready(): + var VR = ARVRServer.find_interface("OpenVR") + if VR and VR.initialize(): + get_viewport().arvr = true + OS.vsync_enabled = false + Engine.target_fps = 90 diff --git a/RayCast.gd b/RayCast.gd @@ -0,0 +1,5 @@ +extends RayCast + + +func _physics_process(delta): + $"Mesh".global_transform.origin = get_collision_point() diff --git a/Spatial.tscn b/Spatial.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://Spatial.gd" type="Script" id=1] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=2] -[ext_resource path="res://shattered_dreams.ogg" type="AudioStream" id=3] [ext_resource path="res://Items/TestGrabbable.tscn" type="PackedScene" id=4] [sub_resource type="PlaneMesh" id=1] @@ -44,10 +43,6 @@ shape = SubResource( 5 ) [node name="Grabbable" parent="." instance=ExtResource( 4 )] [node name="DirectionalLight" type="DirectionalLight" parent="."] -transform = Transform( 0.472826, -0.280103, 0.835451, -0.320795, 0.828346, 0.459275, -0.820686, -0.485166, 0.301808, 0, 0, 0 ) +transform = Transform( 0.472826, -0.280103, 0.835451, -0.320795, 0.828346, 0.459276, -0.820686, -0.485166, 0.301808, 0, 0, 0 ) +light_indirect_energy = 0.1 shadow_enabled = true - -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 3 ) -volume_db = -17.165 -autoplay = true diff --git a/Worlds/CSG_Testing/CSG VR Test.tscn b/Worlds/CSG_Testing/CSG VR Test.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Worlds/CSG_Testing/TestTile01.png" type="Texture" id=1] +[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=2] + +[sub_resource type="SpatialMaterial" id=1] +flags_world_triplanar = true +albedo_texture = ExtResource( 1 ) +uv1_triplanar = true + +[node name="CSG VR Test" type="Spatial"] + +[node name="Room" type="CSGBox" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 ) +use_collision = true +invert_faces = true +width = 14.0 +height = 4.0 +depth = 16.0 +material = SubResource( 1 ) + +[node name="Player" parent="." instance=ExtResource( 2 )] diff --git a/Worlds/CSG_Testing/CSG_tut.tscn b/Worlds/CSG_Testing/CSG_tut.tscn @@ -0,0 +1,74 @@ +[gd_scene format=2] + +[node name="Spatial" type="Spatial"] + +[node name="DirectionalLight" type="DirectionalLight" parent="."] +transform = Transform( 0.573016, -0.777047, 0.260484, -0.228251, 0.15395, 0.961354, -0.787118, -0.610326, -0.0891458, 0, 0, 0 ) +shadow_enabled = true + +[node name="Room" type="CSGBox" parent="."] +invert_faces = true +width = 10.0 +height = 10.0 +depth = 10.0 + +[node name="Desk" type="CSGCombiner" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.42507, -3.54654, 0 ) + +[node name="Surface" type="CSGBox" parent="Desk"] +height = 0.25 +depth = 4.0 + +[node name="Leg" type="CSGBox" parent="Desk"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.851665, -0.737015, -1.83025 ) +width = 0.25 +height = 1.5 +depth = 0.25 + +[node name="Leg2" type="CSGBox" parent="Desk"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.814813, -0.737015, -1.83025 ) +width = 0.25 +height = 1.5 +depth = 0.25 + +[node name="Leg4" type="CSGBox" parent="Desk"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.851665, -0.737015, 1.83845 ) +width = 0.25 +height = 1.5 +depth = 0.25 + +[node name="Leg3" type="CSGBox" parent="Desk"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.814813, -0.737015, 1.83845 ) +width = 0.25 +height = 1.5 +depth = 0.25 + +[node name="Bed" type="CSGCombiner" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.2838, -4.71944, 2.23261 ) + +[node name="Pillow" type="CSGCombiner" parent="Bed"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0827688, 1.04983 ) +operation = 1 + +[node name="CSGSphere" type="CSGSphere" parent="Bed/Pillow"] +transform = Transform( 1, 0, 0, 0, 0.371, 0, 0, 0, 1, 0, 0.343853, 0 ) +radius = 0.516966 + +[node name="CSGSphere2" type="CSGSphere" parent="Bed/Pillow"] +transform = Transform( 1, 0, 0, 0, 0.371, 0, 0, 0, 1, -0.582913, 0.343853, 0 ) +radius = 0.516966 + +[node name="CSGSphere3" type="CSGSphere" parent="Bed/Pillow"] +transform = Transform( 1, 0, 0, 0, 0.371, 0, 0, 0, 1, 0.580643, 0.343853, 0 ) +radius = 0.516966 + +[node name="CSGBox" type="CSGBox" parent="Bed"] +width = 2.60071 +height = 0.480457 +depth = 3.22029 + +[node name="CSGBox2" type="CSGBox" parent="Bed"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.167706, 0 ) +width = 2.27356 +height = 0.480457 +depth = 2.93609 diff --git a/Worlds/CSG_Testing/TestTile01.png b/Worlds/CSG_Testing/TestTile01.png Binary files differ. diff --git a/Worlds/CSG_Testing/TestTile01.png.import b/Worlds/CSG_Testing/TestTile01.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/TestTile01.png-67d7ee87536d115e689590587e15689e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Worlds/CSG_Testing/TestTile01.png" +dest_files=[ "res://.import/TestTile01.png-67d7ee87536d115e689590587e15689e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=1.0 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=true +flags/filter=false +flags/mipmaps=true +flags/anisotropic=true +flags/srgb=2 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/project.godot b/project.godot @@ -19,6 +19,10 @@ config/name="ggj2020" run/main_scene="res://Spatial.tscn" config/icon="res://icon.png" +[autoload] + +ConfigureVR="*res://ConfigureVR.gd" + [gdnative] singletons=[ "res://addons/godot-openvr/godot_openvr.gdnlib" ]