Various updates

Flashlight, fog, letter shader, safe audio
This commit is contained in:
2023-01-31 19:11:38 +01:00
parent 61a732a698
commit 9b7b25ff94
13 changed files with 162 additions and 30 deletions
BIN
View File
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://mi8fox007pdr"
path="res://.godot/imported/button.wav-5d926e4090a9ee9d761a7ef4b34912d7.sample"
[deps]
source_file="res://Audio/button.wav"
dest_files=["res://.godot/imported/button.wav-5d926e4090a9ee9d761a7ef4b34912d7.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
BIN
View File
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://c403ltk7lrae0"
path="res://.godot/imported/reset.wav-36f86b6021adc185635930bd7464724c.sample"
[deps]
source_file="res://Audio/reset.wav"
dest_files=["res://.godot/imported/reset.wav-36f86b6021adc185635930bd7464724c.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
+14 -14
View File
File diff suppressed because one or more lines are too long
+11 -1
View File
File diff suppressed because one or more lines are too long
+28 -6
View File
@@ -1,13 +1,35 @@
[gd_scene load_steps=3 format=3]
[gd_scene load_steps=4 format=3 uid="uid://bmqy37qumb7um"]
[ext_resource type="PackedScene" uid="uid://dv3a33uojtwi0" path="res://Objects/Meshes/tekst.glb" id="1_riskl"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7mr2i"]
emission_enabled = true
emission = Color(1, 1, 1, 1)
emission_energy_multiplier = 0.05
[sub_resource type="Shader" id="Shader_qmlbg"]
code = "// NOTE: Shader automatically converted from Godot Engine 4.0.beta15's StandardMaterial3D.
shader_type spatial;
render_mode specular_disabled;
void light() {
float diff = LIGHT_COLOR.b - LIGHT_COLOR.g - LIGHT_COLOR.r;
if (diff > 0.5 && LIGHT_COLOR.b > LIGHT_COLOR.g && LIGHT_COLOR.b > LIGHT_COLOR.r) {
DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * ALBEDO;
ALPHA = ATTENUATION;
}
}
void fragment() {
ALBEDO = vec3(0.4, 0.8, 1.0);
EMISSION = vec3(0.4, 0.8, 1.0);
ALPHA = 0.0;
}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_q8ihn"]
render_priority = 0
shader = SubResource("Shader_qmlbg")
[node name="tekst" instance=ExtResource("1_riskl")]
[node name="Text" parent="." index="0"]
surface_material_override/0 = SubResource("StandardMaterial3D_7mr2i")
surface_material_override/0 = SubResource("ShaderMaterial_q8ihn")
+11 -2
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3]
[gd_scene load_steps=5 format=3 uid="uid://4o2ljtcup5bo"]
[ext_resource type="Script" path="res://Scripts/Player.gd" id="1_jx17t"]
@@ -23,10 +23,19 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0)
fov = 60.0
[node name="Gun" type="MeshInstance3D" parent="Pivot/Camera"]
[node name="FlashLight" type="MeshInstance3D" parent="Pivot/Camera"]
transform = Transform3D(-4.37114e-08, 0, 1, -1, -4.37114e-08, -4.37114e-08, 4.37114e-08, -1, 1.91069e-15, 0.329452, -0.242565, -0.429142)
mesh = SubResource("CapsuleMesh_x6nb0")
[node name="SpotLight3D" type="SpotLight3D" parent="Pivot/Camera/FlashLight"]
transform = Transform3D(1, -1.64203e-15, 0, 0, -4.37114e-08, -1, 8.35188e-23, 1, -4.37114e-08, 0, -0.0445836, 0)
light_color = Color(0.345098, 0.764706, 1, 1)
light_volumetric_fog_energy = 100000.0
shadow_enabled = true
spot_range = 8.91
spot_angle = 15.0
spot_angle_attenuation = 3.13833
[node name="AudioListener3D" type="AudioListener3D" parent="Pivot/Camera"]
current = true
+27 -3
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
@tool
extends Node3D
const SIZE = 3
const SIZE = 4
enum Direction {UP, RIGHT, DOWN, LEFT}
var sequence = []
+9
View File
@@ -3,6 +3,7 @@ extends CharacterBody3D
const WALK_SPEED = 5.0
const MOUSE_SENS = 0.002
var has_flashlight = false
var mouse_mode = 2
@@ -16,6 +17,8 @@ func _input(event):
elif event.is_action_pressed("mode"):
mouse_mode = mouse_mode ^ 1
Input.set_mouse_mode(mouse_mode)
elif event.is_action_pressed("alt") and has_flashlight:
$Pivot/Camera/FlashLight/SpotLight3D.visible = !$Pivot/Camera/FlashLight/SpotLight3D.visible
func _physics_process(delta):
if mouse_mode == 2:
@@ -24,3 +27,9 @@ func _physics_process(delta):
velocity.x = direction.x * WALK_SPEED
velocity.z = direction.z * WALK_SPEED
move_and_slide()
func _on_flash_light_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Pivot/Camera/FlashLight.visible = true
has_flashlight = true
+8 -3
View File
@@ -10,6 +10,7 @@ func _ready():
bmat.emission_enabled = true
bmat.albedo_color = Color.LIGHT_SLATE_GRAY
bmat.emission = Color.LIGHT_BLUE
bmat.emission_intensity = 0.05
$ButtonUp.set_surface_override_material(0, bmat)
$ButtonLeft.set_surface_override_material(0, bmat)
$ButtonDown.set_surface_override_material(0, bmat)
@@ -17,10 +18,9 @@ func _ready():
func add_sequence_guess(dir):
if sequence[i] == dir:
print(".")
$Button.playing = true
i += 1
if (i == sequence.size()):
print("yay")
$Door.visible = false
$ButtonUp.visible = false
$ButtonDown.visible = false
@@ -28,7 +28,7 @@ func add_sequence_guess(dir):
$ButtonRight.visible = false
i = 0
else:
print("x")
$Reset.playing = true
i = 0
func _on_up_input_event(camera, event, position, normal, shape_idx):
@@ -46,3 +46,8 @@ func _on_down_input_event(camera, event, position, normal, shape_idx):
func _on_right_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
add_sequence_guess(1)
func _on_flash_light_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$FlashLight.visible = false
+5
View File
@@ -57,3 +57,8 @@ mode={
"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":4194306,"key_label":0,"unicode":0,"echo":false,"script":null)
]
}
alt={
"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":2,"pressed":false,"double_click":false,"script":null)
]
}