add basic win indicator
This commit is contained in:
		
							parent
							
								
									1e9eddc4ef
								
							
						
					
					
						commit
						f13be176a9
					
				
					 12 changed files with 207 additions and 4 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								assets/boombap.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/boombap.ogg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										19
									
								
								assets/boombap.ogg.import
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								assets/boombap.ogg.import
									
									
									
									
									
										Normal file
									
								
							|  | @ -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 | ||||||
							
								
								
									
										
											BIN
										
									
								
								assets/crash.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/crash.ogg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										19
									
								
								assets/crash.ogg.import
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								assets/crash.ogg.import
									
									
									
									
									
										Normal file
									
								
							|  | @ -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 | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| [gd_scene load_steps=2 format=3 uid="uid://bgh4fmqrhb0cs"] | [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")] | [node name="Star bulb" instance=ExtResource("1_onaud")] | ||||||
|  |  | ||||||
|  | @ -1,3 +1,3 @@ | ||||||
| [xr] | [xr] | ||||||
| 
 | 
 | ||||||
| openxr/enabled=false | openxr/enabled=true | ||||||
|  |  | ||||||
|  | @ -80,7 +80,16 @@ func check_puzzle_completion(delta: float) -> void: | ||||||
| 		_completion_timer += delta | 		_completion_timer += delta | ||||||
| 		if _completion_timer >= completion_time: | 		if _completion_timer >= completion_time: | ||||||
| 			_puzzle_complete = true | 			_puzzle_complete = true | ||||||
|  | 			print("puzzle completed") | ||||||
| 			puzzle_completed.emit() | 			puzzle_completed.emit() | ||||||
|  | 			force_drop_and_disable_manipulators() | ||||||
| 	else: | 	else: | ||||||
| 		_completion_timer = 0.0 | 		_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 | ||||||
|  |  | ||||||
|  | @ -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="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"] | [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="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="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="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"] | [sub_resource type="Gradient" id="Gradient_0ygfi"] | ||||||
| colors = PackedColorArray(0.720471, 0.182584, 0.797749, 1, 1, 1, 3, 1) | 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) | transform = Transform3D(1.3, 0, 0, 0, 1.3, 0, 0, 0, 1.3, 0, -0.542325, 0) | ||||||
| script = ExtResource("8_ipvvg") | 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"] | [connection signal="occupancy_changed" from="Target1" to="Target1/Star bulb" method="_on_target_1_occupancy_changed"] | ||||||
|  |  | ||||||
|  | @ -102,6 +102,10 @@ shape = SubResource("BoxShape3D_jwkgy") | ||||||
| [node name="Floor" type="MeshInstance3D" parent="."] | [node name="Floor" type="MeshInstance3D" parent="."] | ||||||
| mesh = SubResource("PlaneMesh_gsjte") | 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="."] | [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) | transform = Transform3D(1, 0, 0, 0, 0.571688, 0.820471, 0, -0.820471, 0.571688, 0, 4.06392, -0.511663) | ||||||
| shadow_enabled = true | shadow_enabled = true | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								scenes/win_particles.gd
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								scenes/win_particles.gd
									
									
									
									
									
										Normal file
									
								
							|  | @ -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) | ||||||
							
								
								
									
										137
									
								
								scenes/win_particles.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								scenes/win_particles.tscn
									
									
									
									
									
										Normal file
									
								
							|  | @ -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 | ||||||
		Loading…
	
		Reference in a new issue