added player controller and theme switcher

This commit is contained in:
betalars 2023-02-13 18:39:18 +01:00
parent e580e1a38d
commit 36335d6c12
22 changed files with 899 additions and 11 deletions

View file

@ -26,4 +26,9 @@
- by [Fernand0FC](https://www.deviantart.com/fernand0fc), CC-BY-3.0 - by [Fernand0FC](https://www.deviantart.com/fernand0fc), CC-BY-3.0
+ [Corporate level bodyguard](https://www.deviantart.com/fernand0fc/art/Corporate-level-bodyguard-803579124) + [Corporate level bodyguard](https://www.deviantart.com/fernand0fc/art/Corporate-level-bodyguard-803579124)
+ [Into the glowing sea](https://www.deviantart.com/fernand0fc/art/Into-the-glowing-sea-834238466) + [Into the glowing sea](https://www.deviantart.com/fernand0fc/art/Into-the-glowing-sea-834238466)
+ [Anti-Hero](https://www.deviantart.com/fernand0fc/art/Anti-Hero-555054767) + [Anti-Hero](https://www.deviantart.com/fernand0fc/art/Anti-Hero-555054767)
## Sounds Effects
- [Rain on Windows, Interior](https://freesound.org/people/InspectorJ/sounds/346641/) by [InspectorJ](https://freesound.org/people/InspectorJ/) CC-BY 3.0
- [Rain and thunder](https://freesound.org/people/MrAuralization/sounds/241294/) by [MrAuralization](https://freesound.org/people/MrAuralization/) CC-BY 3.0
- [Heavy Thunder Strike - no Rain - QUADRO](https://freesound.org/people/BlueDelta/sounds/446753/) by [BlueDelta](https://freesound.org/people/BlueDelta/) CC-BY 3.0

View file

@ -0,0 +1,34 @@
0987# Creative Commons Contributions
## 3D-Assets
- [Antique Dresser](https://sketchfab.com/3d-models/boy-room-19035fc846034003b76e2914ba6dd7a6) by [Darren McNerney 3D](https://sketchfab.com/DarrenMcnerney3D) CC-BY
- [Wardrobe - Low poly](https://skfb.ly/ow6TJ) by [ixMkc1](https://sketchfab.com/ixMkc1) CC-BY
- [Simple Bean Bag](https://sketchfab.com/3d-models/simple-bean-bag-64d111cec3d842f09cbb8c68b1e49c8d) by [AleixoAlonso](https://sketchfab.com/AleixoAlonso) CC-BY
- [Cobwebs](https://skfb.ly/ouu9C) by [DJMaesen](https://sketchfab.com/bumstrum) CC-BY
- [Laptop](https://skfb.ly/6RVFt) by [Aullwen](https://sketchfab.com/Aullwen) CC-BY
- [Home Speaker Bar](https://skfb.ly/oqZnY) by [re1monsen] CC-BY
- [Designer Storage Box 2](https://sketchfab.com/3d-models/designer-storage-box-2-db1275e988484908afcf44d0487aed69) by [Raphael Escamilla](https://sketchfab.com/Raffey) CC-BY
- [Carpet Fluffy](https://sketchfab.com/3d-models/carpet-fluffy-435d64ef1e36457790000c6b6aa4b8b2) by [polybEAN](https://sketchfab.com/polybean) CC-BY
- [backpacks blockout homework](https://sketchfab.com/3d-models/backpacks-blockout-homework-e80686790d884b21b52f2308e51af9c6) by [Fellming](https://sketchfab.com/Fellm) CC-BY
## Textures from polyhaven.com
- [Rough Wood](https://polyhaven.com/a/rough_wood) by [Rob Tuytel](https://polyhaven.com/all?a=Rob%20Tuytel) CC-0
- [Brick Wall 001](https://polyhaven.com/a/brick_wall_001) by [Dimitrios Savva](https://polyhaven.com/all?a=Dimitrios%20Savva)
## Textures from AmbientCG.com
- [Fabric 030](https://ambientcg.com/view?id=Fabric030)
- [Wood Substance 009](https://ambientcg.com/view?id=WoodSubstance009)
- [Wicker 010 B](https://ambientcg.com/view?id=Wicker010B)
## Comic Illustrations
- by [Fernand0FC](https://www.deviantart.com/fernand0fc), CC-BY-3.0
+ [Corporate level bodyguard](https://www.deviantart.com/fernand0fc/art/Corporate-level-bodyguard-803579124)
+ [Into the glowing sea](https://www.deviantart.com/fernand0fc/art/Into-the-glowing-sea-834238466)
+ [Anti-Hero](https://www.deviantart.com/fernand0fc/art/Anti-Hero-555054767)
## Sounds Effects
- [Rain on Windows, Interior](https://freesound.org/people/InspectorJ/sounds/346641/) by [InspectorJ](https://freesound.org/people/InspectorJ/) CC-BY 3.0
- [Rain and thunder](https://freesound.org/people/MrAuralization/sounds/241294/) by [MrAuralization](https://freesound.org/people/MrAuralization/) CC-BY 3.0
- [Heavy Thunder Strike - no Rain - QUADRO](https://freesound.org/people/BlueDelta/sounds/446753/) by [BlueDelta](https://freesound.org/people/BlueDelta/) CC-BY 3.0

Binary file not shown.

View file

@ -0,0 +1,23 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/Moving Loop.wav-e545e207fa9ff27f76a02fc01d339916.sample"
[deps]
source_file="res://assets/audio/Moving Loop.wav"
dest_files=[ "res://.import/Moving Loop.wav-e545e207fa9ff27f76a02fc01d339916.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=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,23 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/Voice Loop.wav-2d08b4c0ce5162d4db0c92168da6eb97.sample"
[deps]
source_file="res://assets/audio/Voice Loop.wav"
dest_files=[ "res://.import/Voice Loop.wav-2d08b4c0ce5162d4db0c92168da6eb97.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=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,23 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/Youth Loop.wav-c56c05816437d2641b67ed04f1ec6698.sample"
[deps]
source_file="res://assets/audio/Youth Loop.wav"
dest_files=[ "res://.import/Youth Loop.wav-c56c05816437d2641b67ed04f1ec6698.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=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View file

@ -0,0 +1,60 @@
tool
extends Node
enum themes{
NONE,
BASE,
THEME_1,
THEME_2,
THEME_3,
}
export (themes) var current_theme: int = themes.BASE setget set_theme
var last_theme: int = -1
export (bool) var autoplay:bool = true;
export (bool) var playing:bool = false setget set_playing
export (float) var transition_time:float = 5
var transition_state:float = 1
var max_volume = 0.5
func _ready():
for i in range(themes.size()):
if i > 0:
AudioServer.set_bus_volume_db(i, linear2db(0))
AudioServer.set_bus_mute(i, true)
if not current_theme == 0:
AudioServer.set_bus_volume_db(current_theme, linear2db(max_volume))
AudioServer.set_bus_mute(current_theme, false)
if autoplay and not playing:
set_playing(true)
func _process(delta):
if last_theme != -1:
transition_state += delta/transition_time
if transition_state > 1:
transition_state = 1
if not last_theme == 0: AudioServer.set_bus_mute(last_theme, true)
last_theme = -1
if not current_theme == 0: AudioServer.set_bus_volume_db(current_theme, linear2db(transition_state*max_volume))
if not last_theme == 0: AudioServer.set_bus_volume_db(last_theme, linear2db((1-transition_state)*max_volume))
func set_theme(new_theme):
if last_theme == -1:
last_theme = current_theme
current_theme = new_theme
AudioServer.set_bus_mute(new_theme, false)
transition_state = 0
func set_playing(play_input):
if is_inside_tree():
$Base.playing = play_input
$Theme1.playing = play_input
$Theme2.playing = play_input
$Theme3.playing = play_input
playing = play_input
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

Binary file not shown.

View file

@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/rain and thunder.mp3-6c137a504d3bb8dcbcf1c6df5278de77.mp3str"
[deps]
source_file="res://assets/audio/rain and thunder.mp3"
dest_files=[ "res://.import/rain and thunder.mp3-6c137a504d3bb8dcbcf1c6df5278de77.mp3str" ]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/rain_on_window.mp3-374d3458250129255cb3c39bb518e426.mp3str"
[deps]
source_file="res://assets/audio/rain_on_window.mp3"
dest_files=[ "res://.import/rain_on_window.mp3-374d3458250129255cb3c39bb518e426.mp3str" ]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,23 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/rain_on_window.wav-981250c31d12f65e3981276b6c0169fd.sample"
[deps]
source_file="res://assets/audio/rain_on_window.wav"
dest_files=[ "res://.import/rain_on_window.wav-981250c31d12f65e3981276b6c0169fd.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=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/thunder.mp3-377e8fe21c6dc7e003f9cc638aa3de90.mp3str"
[deps]
source_file="res://assets/audio/thunder.mp3"
dest_files=[ "res://.import/thunder.mp3-377e8fe21c6dc7e003f9cc638aa3de90.mp3str" ]
[params]
loop=true
loop_offset=0

View file

@ -0,0 +1,127 @@
extends RigidBody
export (bool) var active: bool = true setget set_active
export (float, 0, 10) var max_speed: float = 3
export (float, 0, 10) var max_acceleration: float = 5
export (float, 0, 20) var damp: float = 10
export (float, 0.1, 1) var mouse_jerk:float = 0.5
export (float,10, 100) var gamepad_response = 50
export (float, 50, 500) var mouse_jerk_rejection = 200
export (float) var max_angle = 75
export (float) var camera_jitter_speed:float = 3
export (Vector3) var angular_jitter:Vector3 = Vector3(0.1, 0, 0.05)
export (Vector3) var angular_jitter_speed:Vector3 = Vector3(2, 1, 1)
export (Vector3) var location_jitter:Vector3 = Vector3(0.1, 0.1, 0.1)
export (Vector3) var location_jitter_speed:Vector3 = Vector3(3, 0.3, 1)
var loc_noise_spot: Vector3 = Vector3.ZERO
var rot_noise_spot: Vector3 = Vector3.ZERO
var noise:OpenSimplexNoise = OpenSimplexNoise.new()
var rotation_speed: Vector2 = Vector2.ZERO
var current_mouse_rotation: Vector2 = Vector2.ZERO
var mouse_sensitivity: Vector2 = Vector2(3, 3)
var crouched:bool = false
onready var yaw:Spatial = $Yaw
onready var pitch:Spatial = $Yaw/Pitch
onready var mount:Spatial = $Yaw/Pitch/Mount
onready var camera:Camera = $Yaw/Pitch/Mount/Camera
func set_active(activate):
if !is_inside_tree(): return
if activate:
camera.make_current()
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
sleeping = active
func _ready():
if active:
set_active(active)
func _physics_process(delta:float):
_handle_movement(delta)
_handle_rotation(delta)
_handle_jitter(delta)
func _handle_movement(delta:float):
var input:Vector2 = Vector2(Input.get_action_strength("player_right") - Input.get_action_strength("player_left"),
Input.get_action_strength("player_backwards")*0.8 - Input.get_action_strength("player_forwards"))
if input.length()>1:
input = input.normalized()
var direction: Vector3 = Vector3(input.x, 0, input.y)
direction = yaw.global_transform.basis.x * direction.x + transform.basis.y * direction.y + yaw.global_transform.basis.z * direction.z
if linear_velocity.length() > (linear_velocity + (direction*max_speed - linear_velocity)).length():
direction = Vector3.ZERO
else:
direction *= (direction*max_speed - linear_velocity).length()*max_acceleration
linear_damp = damp * max(0.5, 1 - input.length())
apply_central_impulse(direction*delta)
func _handle_rotation(delta:float):
var smoothness = 60/Engine.get_frames_per_second()
var input_speed = Vector2( Input.get_action_strength("look_right")-Input.get_action_strength("look_left"), Input.get_action_strength("look_down")-Input.get_action_strength("look_up")) * gamepad_response
if current_mouse_rotation.length()>0:
input_speed = current_mouse_rotation
current_mouse_rotation = Vector2.ZERO
rotation_speed = rotation_speed * (1-mouse_jerk*smoothness) + input_speed * mouse_jerk * smoothness
if rotation_speed.y > 0 and pitch.rotation_degrees.x < 0:
rotation_speed.y *= 1-pow(pitch.rotation_degrees.x/-max_angle, 4)
elif rotation_speed.y < 0 and pitch.rotation_degrees.x > 0 :
rotation_speed.y *= 1-pow(pitch.rotation_degrees.x/max_angle, 4)
yaw.rotate_y(deg2rad(-rotation_speed.x * delta * mouse_sensitivity.x))
pitch.rotate_x(deg2rad(-rotation_speed.y * delta * mouse_sensitivity.y))
func _handle_jitter(delta):
loc_noise_spot += Vector3(delta * camera_jitter_speed * location_jitter_speed)
rot_noise_spot += Vector3(delta * camera_jitter_speed * angular_jitter_speed)
pitch.translation = Vector3(
noise.get_noise_1d(loc_noise_spot.x),
noise.get_noise_1d(loc_noise_spot.y),
noise.get_noise_1d(loc_noise_spot.z)
) * location_jitter
mount.rotation = Vector3(
noise.get_noise_1d(rot_noise_spot.x),
noise.get_noise_1d(rot_noise_spot.y),
noise.get_noise_1d(rot_noise_spot.z)
) * angular_jitter
func _handle_mouse_input(event:InputEventMouseMotion):
if event.relative.length() < mouse_jerk_rejection:
current_mouse_rotation = event.relative
func _unhandled_input(event:InputEvent):
if active:
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
_handle_mouse_input(event)
func _on_bed_enter(body):
if not crouched:
$PlayerAnimationPlayer.queue("crouch")
max_speed *= .5
crouched = true
func _on_bed_exited(body):
if crouched:
crouched = false
$PlayerAnimationPlayer.queue("stand_up")
yield($PlayerAnimationPlayer, "animation_finished")
max_speed *= 2

View file

@ -1,8 +1,17 @@
[gd_scene load_steps=10 format=2] [gd_scene load_steps=30 format=2]
[ext_resource path="res://assets/youth_room/youth_room.glb" type="PackedScene" id=1] [ext_resource path="res://assets/youth_room/youth_room.glb" type="PackedScene" id=1]
[ext_resource path="res://assets/textures/hdr/pretville_cinema_4k.hdr" type="Texture" id=2] [ext_resource path="res://assets/textures/hdr/pretville_cinema_4k.hdr" type="Texture" id=2]
[ext_resource path="res://assets/audio/rain and thunder.mp3" type="AudioStream" id=3]
[ext_resource path="res://assets/audio/rain_on_window.wav" type="AudioStream" id=4]
[ext_resource path="res://assets/audio/mixxxer.gd" type="Script" id=5]
[ext_resource path="res://assets/youth_room/starlight_catcher_room001.mesh" type="ArrayMesh" id=6] [ext_resource path="res://assets/youth_room/starlight_catcher_room001.mesh" type="ArrayMesh" id=6]
[ext_resource path="res://assets/audio/Voice Loop.wav" type="AudioStream" id=7]
[ext_resource path="res://assets/audio/Moving Loop.wav" type="AudioStream" id=8]
[ext_resource path="res://assets/audio/Youth Loop.wav" type="AudioStream" id=9]
[ext_resource path="res://assets/audio/thunder.mp3" type="AudioStream" id=10]
[ext_resource path="res://base_scenes/PlayerController.gd" type="Script" id=11]
[ext_resource path="res://assets/textures/3D/red_plaster_weathered_diff_4k.jpg" type="Texture" id=12]
[sub_resource type="PanoramaSky" id=1] [sub_resource type="PanoramaSky" id=1]
radiance_size = 4 radiance_size = 4
@ -57,6 +66,28 @@ adjustment_brightness = 1.05
adjustment_contrast = 1.1 adjustment_contrast = 1.1
adjustment_saturation = 0.95 adjustment_saturation = 0.95
[sub_resource type="GDScript" id=7]
script/source = "extends Spatial
export (float) var average_time_interval = 120
export (float) var average_randomnes = 90
var rng: RandomNumberGenerator = RandomNumberGenerator.new()
var waiting:bool = false
func _ready():
rng.randomize()
func _process(_delta):
if not waiting:
delayed_thunder()
func delayed_thunder():
waiting = true
yield(get_tree().create_timer(rng.randfn(average_randomnes, average_time_interval)), \"timeout\")
$AnimationPlayer.play(\"lightning_1\")
waiting = false
"
[sub_resource type="Animation" id=4] [sub_resource type="Animation" id=4]
length = 0.001 length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
@ -95,11 +126,46 @@ tracks/2/keys = {
"update": 0, "update": 0,
"values": [ Vector3( -11.1996, -21.888, 0.294716 ) ] "values": [ Vector3( -11.1996, -21.888, 0.294716 ) ]
} }
tracks/3/type = "value"
tracks/3/path = NodePath("DirectionalLight:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("AnimationPlayer/AudioStreamPlayer3D:playing")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ false ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("AnimationPlayer/AudioStreamPlayer3D:unit_db")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}
[sub_resource type="Animation" id=5] [sub_resource type="Animation" id=5]
resource_name = "lightning_1" resource_name = "lightning_1"
length = 6.0 length = 15.0
loop = true
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/path = NodePath("DirectionalLight:light_energy") tracks/0/path = NodePath("DirectionalLight:light_energy")
tracks/0/interp = 1 tracks/0/interp = 1
@ -136,6 +202,42 @@ tracks/2/keys = {
"update": 0, "update": 0,
"values": [ Vector3( -11.1996, -21.888, 0.294716 ), Vector3( -4.21738, -20.3734, -1.9015 ), Vector3( -14.9022, 16.7652, -25.4545 ), Vector3( -13.3357, 0.411877, -14.5606 ), Vector3( -6.80584, -27.9889, -5.83255 ) ] "values": [ Vector3( -11.1996, -21.888, 0.294716 ), Vector3( -4.21738, -20.3734, -1.9015 ), Vector3( -14.9022, 16.7652, -25.4545 ), Vector3( -13.3357, 0.411877, -14.5606 ), Vector3( -6.80584, -27.9889, -5.83255 ) ]
} }
tracks/3/type = "value"
tracks/3/path = NodePath("DirectionalLight:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0, 5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ true, false ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("AnimationPlayer/AudioStreamPlayer3D:playing")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0, 0.2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("AnimationPlayer/AudioStreamPlayer3D:unit_db")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0.7, 11.4, 15 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ 0.0, 0.0, -80.0 ]
}
[sub_resource type="GDScript" id=6] [sub_resource type="GDScript" id=6]
script/source = "tool script/source = "tool
@ -145,6 +247,26 @@ func _process(delta):
light_energy = get_parent().light_energy/16 light_energy = get_parent().light_energy/16
" "
[sub_resource type="GDScript" id=17]
script/source = "extends OmniLight
export (float) var strength:float = 0.3
export (float) var speed:float = 0.5
var noise = OpenSimplexNoise.new()
var spot:float = randf()
var base_energy = light_energy
func _process(delta):
spot += speed*delta
light_energy = base_energy * (1 + noise.get_noise_1d(spot) * strength)
"
[sub_resource type="SpatialMaterial" id=18]
transmission_enabled = true
transmission = Color( 0.886275, 0.686275, 0.309804, 1 )
transmission_texture = ExtResource( 12 )
uv1_triplanar = true
[sub_resource type="GDScript" id=3] [sub_resource type="GDScript" id=3]
script/source = "extends Label script/source = "extends Label
@ -152,6 +274,107 @@ func _process(_delta):
text = String(Engine.get_frames_per_second()) text = String(Engine.get_frames_per_second())
" "
[sub_resource type="PhysicsMaterial" id=10]
friction = 0.0
[sub_resource type="SphereShape" id=8]
radius = 0.307047
[sub_resource type="Animation" id=11]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Yaw:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 1.22534, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Yaw/Pitch/Mount/Camera:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ) ]
}
[sub_resource type="Animation" id=12]
resource_name = "crouch"
length = 3.0
tracks/0/type = "value"
tracks/0/path = NodePath("Yaw:translation")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1.2, 1.9, 2.6 ),
"transitions": PoolRealArray( 1.36604, 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 1.22534, 0 ), Vector3( 0, 0.5, 0 ), Vector3( 0, 0.27, 0 ), Vector3( 0, 0.327816, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Yaw/Pitch/Mount/Camera:rotation_degrees")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.6, 1.6, 2.4, 3 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( -30, 0, -10 ), Vector3( -20, 0, 3 ), Vector3( 0, 0, 0 ), Vector3( 0, 0, 0 ) ]
}
[sub_resource type="Animation" id=14]
resource_name = "stand_up"
length = 3.0
tracks/0/type = "value"
tracks/0/path = NodePath("Yaw:translation")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.9, 1.7, 3 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0.327816, 0 ), Vector3( 0, 0.331, 0 ), Vector3( 0, 1.3, 0 ), Vector3( 0, 1.22534, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Yaw/Pitch/Mount/Camera:rotation_degrees")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.6, 1.3, 2.2, 3 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( -4.79133, 3.17287, -3.71499 ), Vector3( 24.594, -3.154, -4.794 ), Vector3( 0.103793, -1.69217, -1.78899 ), Vector3( 0, 0, 0 ) ]
}
[sub_resource type="SpatialMaterial" id=9]
flags_transparent = true
flags_no_depth_test = true
params_blend_mode = 1
albedo_color = Color( 0.00784314, 0.447059, 0.392157, 1 )
[sub_resource type="CapsuleShape" id=16]
height = 1.46895
[sub_resource type="BoxShape" id=15]
extents = Vector3( 1.18485, 0.383561, 2.18611 )
[node name="Spatial" type="Spatial"] [node name="Spatial" type="Spatial"]
[node name="youth_room" parent="." instance=ExtResource( 1 )] [node name="youth_room" parent="." instance=ExtResource( 1 )]
@ -166,15 +389,20 @@ depth = 4.39209
environment = SubResource( 2 ) environment = SubResource( 2 )
[node name="Thunder" type="Spatial" parent="WorldEnvironment"] [node name="Thunder" type="Spatial" parent="WorldEnvironment"]
visible = false script = SubResource( 7 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="WorldEnvironment/Thunder"] [node name="AnimationPlayer" type="AnimationPlayer" parent="WorldEnvironment/Thunder"]
autoplay = "lightning_1"
anims/RESET = SubResource( 4 ) anims/RESET = SubResource( 4 )
anims/lightning_1 = SubResource( 5 ) anims/lightning_1 = SubResource( 5 )
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="WorldEnvironment/Thunder/AnimationPlayer"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.36406, 4.70203, 0.281747 )
stream = ExtResource( 10 )
attenuation_filter_db = -11.9
[node name="DirectionalLight" type="SpotLight" parent="WorldEnvironment/Thunder"] [node name="DirectionalLight" type="SpotLight" parent="WorldEnvironment/Thunder"]
transform = Transform( 0.928274, 0.0676328, -0.365694, 0.00504578, 0.980943, 0.194227, 0.371861, -0.182142, 0.910243, 0, 2.42148, 5.72203 ) transform = Transform( 0.928274, 0.0676328, -0.365694, 0.00504578, 0.980943, 0.194227, 0.371861, -0.182142, 0.910243, 0, 2.42148, 5.72203 )
visible = false
light_color = Color( 0.87451, 0.968627, 1, 1 ) light_color = Color( 0.87451, 0.968627, 1, 1 )
light_energy = 0.0 light_energy = 0.0
light_specular = 4.662 light_specular = 4.662
@ -200,26 +428,36 @@ omni_range = 4.66672
omni_attenuation = 0.329878 omni_attenuation = 0.329878
[node name="OmniLight2" type="OmniLight" parent="WorldEnvironment"] [node name="OmniLight2" type="OmniLight" parent="WorldEnvironment"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.931734, 1.87783, 0.470971 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.14693, 1.24355, -0.849952 )
light_color = Color( 1, 0.647059, 0.447059, 1 ) light_color = Color( 1, 0.647059, 0.447059, 1 )
light_energy = 0.2 light_energy = 0.2
light_cull_mask = 4294966273 light_cull_mask = 4294966273
shadow_enabled = true shadow_enabled = true
shadow_bias = 0.034 shadow_bias = 0.034
omni_range = 3.81869 omni_range = 2.13746
omni_attenuation = 0.554784 omni_attenuation = 0.554784
omni_shadow_mode = 0 omni_shadow_mode = 0
script = SubResource( 17 )
strength = 0.5
speed = 20.0
[node name="CSGSphere" type="CSGSphere" parent="WorldEnvironment/OmniLight2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00332808, -0.0260651, 0 )
radius = 0.0975696
radial_segments = 32
rings = 24
material = SubResource( 18 )
[node name="SpotLight" type="SpotLight" parent="WorldEnvironment"] [node name="SpotLight" type="SpotLight" parent="WorldEnvironment"]
transform = Transform( 0.99801, 0.0320666, 0.0542887, -0.0630518, 0.507564, 0.859304, 0, -0.861017, 0.508576, -0.585629, 1.40734, 1.63678 ) transform = Transform( 0.99801, 0.0320666, 0.0542887, -0.0628651, 0.439855, 0.895866, 0.00484825, -0.897496, 0.440996, -0.585629, 1.46257, 1.66883 )
light_color = Color( 0.952941, 0.694118, 0.419608, 1 ) light_color = Color( 0.952941, 0.694118, 0.419608, 1 )
light_energy = 4.0 light_energy = 4.0
light_cull_mask = 4294966273 light_cull_mask = 4294966273
spot_range = 1.3341 spot_range = 1.3341
spot_angle = 53.3304 spot_angle = 62.7299
[node name="OmniLight" type="OmniLight" parent="WorldEnvironment/SpotLight"] [node name="OmniLight" type="OmniLight" parent="WorldEnvironment/SpotLight"]
transform = Transform( 1, 0, 0, 0, 1, 2.98023e-08, 0, 2.98023e-08, 1, 0.00947899, 0.0839477, -0.379508 ) transform = Transform( 1, 0, 0, 0, 1, 2.98023e-08, 0, 2.98023e-08, 1, 0.0123327, 0.106834, -0.445482 )
light_color = Color( 1, 0.666667, 0.470588, 1 ) light_color = Color( 1, 0.666667, 0.470588, 1 )
light_energy = 0.2 light_energy = 0.2
light_cull_mask = 4294966273 light_cull_mask = 4294966273
@ -230,6 +468,7 @@ omni_shadow_mode = 0
[node name="Camera" type="Camera" parent="."] [node name="Camera" type="Camera" parent="."]
transform = Transform( 0.906234, 0.00170183, 0.422774, 0.0332697, 0.996604, -0.0753268, -0.421466, 0.0823293, 0.903099, 1.239, 1.104, 2.447 ) transform = Transform( 0.906234, 0.00170183, 0.422774, 0.0332697, 0.996604, -0.0753268, -0.421466, 0.0823293, 0.903099, 1.239, 1.104, 2.447 )
visible = false
cull_mask = 1048573 cull_mask = 1048573
[node name="Label" type="Label" parent="Camera"] [node name="Label" type="Label" parent="Camera"]
@ -257,3 +496,147 @@ light_cull_mask = 4294966288
spot_range = 3.22806 spot_range = 3.22806
spot_attenuation = 3.13834 spot_attenuation = 3.13834
spot_angle = 40.3476 spot_angle = 40.3476
[node name="Window_Rain" type="AudioStreamPlayer3D" parent="."]
transform = Transform( -0.704706, 0.101673, 0.702177, -0.367406, 0.794355, -0.483749, -0.606961, -0.598885, -0.522432, 3.33677, 1.64008, -0.408377 )
stream = ExtResource( 4 )
unit_size = 3.0
autoplay = true
emission_angle_enabled = true
emission_angle_degrees = 60.0
emission_angle_filter_attenuation_db = -16.9
[node name="rain" type="AudioStreamPlayer3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.379912, 4.15043, 5.52654 )
stream = ExtResource( 3 )
attenuation_model = 3
unit_db = 60.0
unit_size = 10.0
[node name="theme switcher" type="Node" parent="."]
script = ExtResource( 5 )
current_theme = 2
[node name="Base" type="AudioStreamPlayer" parent="theme switcher"]
stream = ExtResource( 8 )
bus = "base"
[node name="Theme1" type="AudioStreamPlayer" parent="theme switcher"]
stream = ExtResource( 7 )
bus = "theme 1"
[node name="Theme2" type="AudioStreamPlayer" parent="theme switcher"]
stream = ExtResource( 9 )
bus = "theme 2"
[node name="Theme3" type="AudioStreamPlayer" parent="theme switcher"]
stream = ExtResource( 9 )
bus = "theme 3"
[node name="PlayerController" type="RigidBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.26517, 1.19209e-07, 1.70185 )
collision_layer = 3
mode = 2
physics_material_override = SubResource( 10 )
can_sleep = false
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource( 11 )
[node name="Yaw" type="Spatial" parent="PlayerController"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.22534, 0 )
[node name="Pitch" type="Spatial" parent="PlayerController/Yaw"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.256493, 0 )
[node name="Mount" type="Spatial" parent="PlayerController/Yaw/Pitch"]
[node name="Camera" type="Camera" parent="PlayerController/Yaw/Pitch/Mount"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157 )
current = true
[node name="PlayerCollision" type="CollisionShape" parent="PlayerController"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.322255, 0 )
shape = SubResource( 8 )
[node name="PlayerAnimationPlayer" type="AnimationPlayer" parent="PlayerController"]
autoplay = "RESET"
anims/RESET = SubResource( 11 )
anims/crouch = SubResource( 12 )
anims/stand_up = SubResource( 14 )
[node name="Collission" type="CSGCombiner" parent="."]
transform = Transform( 0.995, 0, 0, 0, 0.995, 0, 0, 0, 0.995, 0, 0, 0 )
visible = false
material_override = SubResource( 9 )
use_collision = true
[node name="Floor" type="CSGBox" parent="Collission"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.74991, -0.174017, 0.789084 )
width = 5.69834
height = 0.283383
depth = 3.76097
[node name="table" type="CSGBox" parent="Collission"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.680222, 0.403589, 1.30899 )
width = 1.13894
height = 0.791526
depth = 1.5274
[node name="wardrobe" type="CSGBox" parent="Collission"]
transform = Transform( 0.999264, 0, -0.0383704, 0, 1, 0, 0.0383704, 0, 0.999264, -0.720471, 0.996671, -0.0772509 )
width = 0.461723
height = 1.95667
depth = 1.14745
[node name="shelf" type="CSGBox" parent="Collission"]
transform = Transform( 0.999986, 0, 0.00534072, 0, 1, 0, -0.00534072, 0, 0.999986, 2.03296, 0.546612, -0.264768 )
width = 0.461723
height = 1.15958
depth = 1.50443
[node name="CSGBox2" type="CSGBox" parent="Collission"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.74991, 1.0663, -1.20373 )
width = 5.69834
height = 2.79671
depth = 0.34587
[node name="CSGBox3" type="CSGBox" parent="Collission"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.74991, 1.0663, 2.74354 )
width = 5.69834
height = 2.79671
depth = 0.34587
[node name="CSGSphere" type="CSGSphere" parent="Collission"]
transform = Transform( 0.427574, 0, -0.0164183, 0, 0.427888, 0, 0.0164183, 0, 0.427574, 0.16543, 0.205297, 2.36964 )
[node name="enter_cave" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.33783, -0.218999, 0.438577 )
collision_layer = 2
collision_mask = 2
[node name="CollisionShape" type="CollisionShape" parent="enter_cave"]
shape = SubResource( 16 )
[node name="exit_cave" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.08284, 0.282891, 0.112718 )
collision_layer = 2
collision_mask = 2
[node name="CollisionShape" type="CollisionShape" parent="exit_cave"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.382153, 2.38419e-07, -1.18237 )
shape = SubResource( 15 )
[node name="exit_cave_backup" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.40116, 0.282891, -0.0817709 )
collision_layer = 2
collision_mask = 2
[node name="CollisionShape" type="CollisionShape" parent="exit_cave_backup"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.193191, 0, 0.659401 )
shape = SubResource( 15 )
[connection signal="body_entered" from="enter_cave" to="PlayerController" method="_on_bed_enter"]
[connection signal="body_exited" from="exit_cave" to="PlayerController" method="_on_bed_exited"]
[connection signal="body_exited" from="exit_cave_backup" to="PlayerController" method="_on_bed_exited"]

View file

@ -0,0 +1,33 @@
[gd_resource type="AudioBusLayout" format=2]
[resource]
bus/1/name = "base"
bus/1/solo = false
bus/1/mute = true
bus/1/bypass_fx = false
bus/1/volume_db = -67.9895
bus/1/send = "Master"
bus/2/name = "theme 1"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = -6.0206
bus/2/send = "Master"
bus/3/name = "theme 2"
bus/3/solo = false
bus/3/mute = true
bus/3/bypass_fx = false
bus/3/volume_db = inf_neg
bus/3/send = "Master"
bus/4/name = "theme 3"
bus/4/solo = false
bus/4/mute = true
bus/4/bypass_fx = false
bus/4/volume_db = inf_neg
bus/4/send = "Master"
bus/5/name = "gewitter"
bus/5/solo = false
bus/5/mute = false
bus/5/bypass_fx = false
bus/5/volume_db = -6.57885
bus/5/send = "Master"

View file

@ -0,0 +1,65 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://assets/audio/Youth Loop.wav" type="AudioStream" id=1]
[ext_resource path="res://assets/audio/Moving Loop.wav" type="AudioStream" id=2]
[ext_resource path="res://assets/audio/Voice Loop.wav" type="AudioStream" id=3]
[ext_resource path="res://assets/audio/mixxxer.gd" type="Script" id=4]
[ext_resource path="res://assets/audio/rain_on_window.mp3" type="AudioStream" id=5]
[ext_resource path="res://base_scenes/PlayerController.gd" type="Script" id=6]
[sub_resource type="CapsuleShape" id=1]
[node name="Lars wars" type="Spatial"]
[node name="Node" type="Node" parent="."]
script = ExtResource( 4 )
autoplay = false
[node name="Base" type="AudioStreamPlayer" parent="Node"]
stream = ExtResource( 2 )
autoplay = true
bus = "Base Theme"
[node name="Theme1" type="AudioStreamPlayer" parent="Node"]
stream = ExtResource( 3 )
autoplay = true
bus = "Theme 1"
[node name="Theme2" type="AudioStreamPlayer" parent="Node"]
stream = ExtResource( 1 )
autoplay = true
bus = "Theme 2"
[node name="Theme3" type="AudioStreamPlayer" parent="Node"]
stream = ExtResource( 1 )
autoplay = true
bus = "Theme 3"
[node name="Window_Rain" type="AudioStreamPlayer3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0827, -3.48957 )
stream = ExtResource( 5 )
unit_size = 3.0
[node name="CSGCombiner" type="CSGCombiner" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.04933, 0 )
use_collision = true
[node name="CSGBox" type="CSGBox" parent="CSGCombiner"]
width = 7.37721
depth = 5.83045
[node name="CSGBox2" type="CSGBox" parent="CSGCombiner"]
transform = Transform( -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, -3.42112, 3.28005, 0 )
width = 7.37721
depth = 5.83045
[node name="PlayerController" type="RigidBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.41113, 0 )
mode = 2
script = ExtResource( 6 )
[node name="Camera" type="Camera" parent="PlayerController"]
[node name="PlayerCollision" type="CollisionShape" parent="PlayerController"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 1 )

View file

@ -30,6 +30,50 @@ click={
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
] ]
} }
player_forwards={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
]
}
player_backwards={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
]
}
player_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
}
player_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
}
look_up={
"deadzone": 0.5,
"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":1.0,"script":null)
]
}
look_down={
"deadzone": 0.5,
"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":-1.0,"script":null)
]
}
look_left={
"deadzone": 0.5,
"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":-1.0,"script":null)
]
}
look_right={
"deadzone": 0.5,
"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":1.0,"script":null)
]
}
[input_devices] [input_devices]