diff --git a/assets/boombap.ogg b/assets/boombap.ogg new file mode 100644 index 0000000..11b320b Binary files /dev/null and b/assets/boombap.ogg differ diff --git a/assets/boombap.ogg.import b/assets/boombap.ogg.import new file mode 100644 index 0000000..745b777 --- /dev/null +++ b/assets/boombap.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://iquu0ttk5ib1" +path="res://.godot/imported/boombap.ogg-87f100dad48530603cd8a71c6b152bfc.oggvorbisstr" + +[deps] + +source_file="res://assets/boombap.ogg" +dest_files=["res://.godot/imported/boombap.ogg-87f100dad48530603cd8a71c6b152bfc.oggvorbisstr"] + +[params] + +loop=true +loop_offset=0.0 +bpm=140.0 +beat_count=0 +bar_beats=4 diff --git a/assets/crash.ogg b/assets/crash.ogg new file mode 100644 index 0000000..0a7e106 Binary files /dev/null and b/assets/crash.ogg differ diff --git a/assets/crash.ogg.import b/assets/crash.ogg.import new file mode 100644 index 0000000..5a66823 --- /dev/null +++ b/assets/crash.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://chh3mqdtd3nw4" +path="res://.godot/imported/crash.ogg-b1191c6b92c1b51c76cfcb881e83d310.oggvorbisstr" + +[deps] + +source_file="res://assets/crash.ogg" +dest_files=["res://.godot/imported/crash.ogg-b1191c6b92c1b51c76cfcb881e83d310.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/star_bulb.tscn b/assets/star_bulb.tscn index cd02369..ba575fd 100644 --- a/assets/star_bulb.tscn +++ b/assets/star_bulb.tscn @@ -1,5 +1,5 @@ [gd_scene load_steps=2 format=3 uid="uid://bgh4fmqrhb0cs"] -[ext_resource type="PackedScene" uid="uid://ewhlayr70v2l" path="res://assets/Star bulb.glb" id="1_onaud"] +[ext_resource type="PackedScene" uid="uid://ewhlayr70v2l" path="res://assets/Models/Star bulb.glb" id="1_onaud"] [node name="Star bulb" instance=ExtResource("1_onaud")] diff --git a/override.cfg b/override.cfg index 0d1998e..4cd32b3 100644 --- a/override.cfg +++ b/override.cfg @@ -1,3 +1,3 @@ [xr] -openxr/enabled=false +openxr/enabled=true diff --git a/scenes/base_game_scene.gd b/scenes/base_game_scene.gd index 32cce39..15a86d5 100644 --- a/scenes/base_game_scene.gd +++ b/scenes/base_game_scene.gd @@ -80,7 +80,16 @@ func check_puzzle_completion(delta: float) -> void: _completion_timer += delta if _completion_timer >= completion_time: _puzzle_complete = true + print("puzzle completed") puzzle_completed.emit() + force_drop_and_disable_manipulators() else: _completion_timer = 0.0 + +# Force drop and disable all manipulators when puzzle is complete +func force_drop_and_disable_manipulators(): + var manipulators = get_tree().get_nodes_in_group("manipulators") + for manipulator in manipulators: + manipulator.drop() + manipulator.enabled = false diff --git a/scenes/manipulator/manipulator.gd b/scenes/manipulator/manipulator.gd index 1f6cd43..b9c3a06 100644 --- a/scenes/manipulator/manipulator.gd +++ b/scenes/manipulator/manipulator.gd @@ -6,7 +6,7 @@ class_name Manipulator extends XRToolsPickable var held_controller: XRController3D = null - + var attractor: GPUParticlesAttractorSphere3D const MIN_SCALE = 0.5 diff --git a/scenes/tutorial_scenes/tutorial_scene_1.tscn b/scenes/tutorial_scenes/tutorial_scene_1.tscn index b5cb36d..d6a1ed4 100644 --- a/scenes/tutorial_scenes/tutorial_scene_1.tscn +++ b/scenes/tutorial_scenes/tutorial_scene_1.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://dqbxp72mjmbc"] +[gd_scene load_steps=25 format=3 uid="uid://dqbxp72mjmbc"] [ext_resource type="PackedScene" uid="uid://1rwj4eq63xgb" path="res://scenes/tutorial_scenes/tutorial_scene_base.tscn" id="1_lkcbi"] [ext_resource type="VoxelGIData" uid="uid://nuw3xyd4kkpq" path="res://scenes/tutorial_scenes/tutorial_scene_1.VoxelGI_data.res" id="2_4e4av"] @@ -8,6 +8,7 @@ [ext_resource type="AudioStream" uid="uid://cqb1bo72232vs" path="res://assets/Sounds/03 highpiano.ogg" id="6_bxnqe"] [ext_resource type="PackedScene" uid="uid://bgh4fmqrhb0cs" path="res://assets/star_bulb.tscn" id="7_aq638"] [ext_resource type="Script" path="res://assets/star_bulb_target.gd" id="8_ipvvg"] +[ext_resource type="PackedScene" uid="uid://bu0fu4uiwyu65" path="res://scenes/win_particles.tscn" id="9_31knv"] [sub_resource type="Gradient" id="Gradient_0ygfi"] colors = PackedColorArray(0.720471, 0.182584, 0.797749, 1, 1, 1, 3, 1) @@ -179,4 +180,8 @@ autoplay = true transform = Transform3D(1.3, 0, 0, 0, 1.3, 0, 0, 0, 1.3, 0, -0.542325, 0) script = ExtResource("8_ipvvg") +[node name="WinParticles" parent="." index="20" instance=ExtResource("9_31knv")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, -3) + +[connection signal="puzzle_completed" from="." to="WinParticles" method="_on_puzzle_completed"] [connection signal="occupancy_changed" from="Target1" to="Target1/Star bulb" method="_on_target_1_occupancy_changed"] diff --git a/scenes/tutorial_scenes/tutorial_scene_base.tscn b/scenes/tutorial_scenes/tutorial_scene_base.tscn index 7c345d9..5aee0ab 100644 --- a/scenes/tutorial_scenes/tutorial_scene_base.tscn +++ b/scenes/tutorial_scenes/tutorial_scene_base.tscn @@ -102,6 +102,10 @@ shape = SubResource("BoxShape3D_jwkgy") [node name="Floor" type="MeshInstance3D" parent="."] mesh = SubResource("PlaneMesh_gsjte") +[node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="Floor"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -3) +size = Vector3(10, 0.1, 10) + [node name="SpotLight3D" type="SpotLight3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.571688, 0.820471, 0, -0.820471, 0.571688, 0, 4.06392, -0.511663) shadow_enabled = true diff --git a/scenes/win_particles.gd b/scenes/win_particles.gd new file mode 100644 index 0000000..a05718e --- /dev/null +++ b/scenes/win_particles.gd @@ -0,0 +1,10 @@ +extends GPUParticles3D + +func _ready() -> void: + $boombap.volume_db = linear_to_db(0.0) + +func _on_puzzle_completed() -> void: + emitting = true + $Crash.play() + var tween = create_tween() + tween.tween_property($boombap, "volume_db", linear_to_db(1.0), 2.0) diff --git a/scenes/win_particles.tscn b/scenes/win_particles.tscn new file mode 100644 index 0000000..27123dd --- /dev/null +++ b/scenes/win_particles.tscn @@ -0,0 +1,137 @@ +[gd_scene load_steps=8 format=3 uid="uid://bu0fu4uiwyu65"] + +[ext_resource type="Script" path="res://scenes/win_particles.gd" id="1_ittcg"] +[ext_resource type="AudioStream" uid="uid://chh3mqdtd3nw4" path="res://assets/crash.ogg" id="2_sr0qd"] +[ext_resource type="AudioStream" uid="uid://iquu0ttk5ib1" path="res://assets/boombap.ogg" id="3_xnety"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_bm8qp"] +particle_flag_align_y = true +emission_shape_scale = Vector3(3, 1, 3) +emission_shape = 3 +emission_box_extents = Vector3(1, 1, 1) +angle_min = -122.4 +angle_max = 151.5 +spread = 180.0 +initial_velocity_min = 0.1 +initial_velocity_max = 0.5 +angular_velocity_min = -105.82 +angular_velocity_max = 157.69 +gravity = Vector3(0, -5, 0) +damping_min = 2.0 +damping_max = 3.0 +scale_min = 0.5 +scale_max = 2.0 +color = Color(0.997807, 0.645565, 0.348555, 1) +hue_variation_min = -0.33 +hue_variation_max = 0.33 +turbulence_enabled = true +turbulence_noise_scale = 5.45 +collision_mode = 1 +collision_friction = 1.0 +collision_bounce = 0.0 + +[sub_resource type="Shader" id="Shader_xdn50"] +code = "// NOTE: Shader automatically converted from Godot Engine 4.3.stable's StandardMaterial3D. + +shader_type spatial; +render_mode blend_mix, depth_draw_opaque, cull_disabled, diffuse_burley, specular_schlick_ggx, vertex_lighting; + +uniform vec4 albedo : source_color; +uniform sampler2D texture_albedo : source_color, filter_linear_mipmap, repeat_enable; +uniform float point_size : hint_range(0.1, 128.0, 0.1); + +uniform float roughness : hint_range(0.0, 1.0); +uniform sampler2D texture_metallic : hint_default_white, filter_linear_mipmap, repeat_enable; +uniform vec4 metallic_texture_channel; +uniform sampler2D texture_roughness : hint_roughness_r, filter_linear_mipmap, repeat_enable; + +uniform float specular : hint_range(0.0, 1.0, 0.01); +uniform float metallic : hint_range(0.0, 1.0, 0.01); + +uniform sampler2D texture_emission : source_color, hint_default_black, filter_linear_mipmap, repeat_enable; +uniform vec4 emission : source_color; +uniform float emission_energy : hint_range(0.0, 100.0, 0.01); + +uniform vec3 uv1_scale; +uniform vec3 uv1_offset; +uniform vec3 uv2_scale; +uniform vec3 uv2_offset; + +void vertex() { + // Vertex Color is sRGB: Enabled + if (!OUTPUT_IS_SRGB) { + COLOR.rgb = mix( + pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), + COLOR.rgb * (1.0 / 12.92), + lessThan(COLOR.rgb, vec3(0.04045))); + } + + // Shading Mode: Per Vertex + ROUGHNESS = roughness; + + UV = UV * uv1_scale.xy + uv1_offset.xy; +} + +void fragment() { + vec2 base_uv = UV; + + vec4 albedo_tex = texture(texture_albedo, base_uv); + + // Vertex Color Use as Albedo: Enabled + albedo_tex *= COLOR; + + ALBEDO = albedo.rgb * albedo_tex.rgb; + + float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel); + METALLIC = metallic_tex * metallic; + SPECULAR = specular; + + vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0); + float roughness_tex = dot(texture(texture_roughness, base_uv), roughness_texture_channel); + ROUGHNESS = roughness_tex * roughness; + + // Emission Operator: Add + EMISSION = ALBEDO * emission_energy; +} +" + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_bvlxl"] +render_priority = 0 +shader = SubResource("Shader_xdn50") +shader_parameter/albedo = Color(1, 1, 1, 1) +shader_parameter/point_size = 1.0 +shader_parameter/roughness = 1.0 +shader_parameter/metallic_texture_channel = null +shader_parameter/specular = 1.0 +shader_parameter/metallic = 1.0 +shader_parameter/emission = Color(0.996454, 0.721284, 0.467443, 1) +shader_parameter/emission_energy = 0.5 +shader_parameter/uv1_scale = Vector3(1, 1, 1) +shader_parameter/uv1_offset = Vector3(0, 0, 0) +shader_parameter/uv2_scale = Vector3(1, 1, 1) +shader_parameter/uv2_offset = Vector3(0, 0, 0) + +[sub_resource type="QuadMesh" id="QuadMesh_tfxeh"] +material = SubResource("ShaderMaterial_bvlxl") +size = Vector2(0.01, 0.01) +orientation = 1 + +[node name="WinParticles" type="GPUParticles3D"] +emitting = false +amount = 3000 +lifetime = 20.0 +one_shot = true +explosiveness = 0.75 +randomness = 0.58 +visibility_aabb = AABB(-8, -8, -8, 16, 16, 16) +process_material = SubResource("ParticleProcessMaterial_bm8qp") +draw_pass_1 = SubResource("QuadMesh_tfxeh") +script = ExtResource("1_ittcg") + +[node name="Crash" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("2_sr0qd") +volume_db = -10.444 + +[node name="boombap" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("3_xnety") +autoplay = true