Compare commits

...

2 Commits

Author SHA1 Message Date
9dc31a11f6 Refactored Interaction and Save System
- Added a save override confirmation in main menu.
- Added Interaction types.
- Added some test interactions.
- Also added a ViewRollEffect for the player camera.
- Also also added a cubemap generator (CubeMapGeneratorCamera).
2026-01-03 12:45:39 +01:00
9da3ddcf35 Many small changes and improvements
- Improved the TimedMusicAnimationPlayer.
- Added function call exclusions in AnimPlayerEditorCalls (currently 'free' and 'queue_free').
- Added a weak controller setting, which boosts controller vibrations if the controller needs just more kick.
- Changed some material settings.
2026-01-03 12:29:17 +01:00
145 changed files with 8893 additions and 617 deletions

View File

@ -5,6 +5,7 @@ signal beat_tick(beat: int)
const SPEED_TRANSITION_DISTANCE: float = 0.1
@export var chase_anim: StringName = &""
@export var chase_anim_karaoke: StringName = &""
@export var debug_from_marker: StringName = &""
@export var bpm: float = 160.0
@export var debug_play_beat_tick: bool = false
@ -48,18 +49,19 @@ func _process(_delta: float) -> void:
func _physics_process(delta: float) -> void:
if not music_animation.is_playing():
return
# TODO: Calculate the speed scale based on the balls speed divided by the current player speed.
var player_character: PlayerCharacter = GameGlobals.player
var player: PlayerCharacter = GameGlobals.player
var local_position: Vector3 = progress_track.to_local(player_character.global_position)
var local_position: Vector3 = progress_track.to_local(player.global_position)
var player_offset: float = progress_track.curve.get_closest_offset(local_position)
var desired_speed_scale: float = remap(
(player_desired_progress.progress - player_offset) + SPEED_TRANSITION_DISTANCE,
0.0, SPEED_TRANSITION_DISTANCE,
0.1, 1.05
)
player_character.speed_scale = move_toward(
player_character.speed_scale,
player.speed_scale = move_toward(
player.speed_scale,
clampf(desired_speed_scale, 0.1, 1.1),
delta
)
@ -67,9 +69,9 @@ func _physics_process(delta: float) -> void:
func _on_start_chase_area_body_entered(_body: Node3D) -> void:
if not OS.is_debug_build() or debug_from_marker.is_empty():
music_animation.play(chase_anim)
music_animation.play(_get_chase_anim_name())
else:
music_animation.play_section_with_markers(chase_anim, debug_from_marker)
music_animation.play_section_with_markers(_get_chase_anim_name(), debug_from_marker)
await get_tree().process_frame
var player: PlayerCharacter = GameGlobals.get_player()
@ -81,4 +83,11 @@ func _on_beat_tick(beat: int) -> void:
if debug_play_beat_tick:
beat_sfx.play()
debug_visualizer.scale = Vector3.ONE * (1.25 if beat % 2 == 0 else 1.0)
debug_visualizer.scale = Vector3.ONE * (0.85 if beat % 2 == 0 else 1.0)
func _get_chase_anim_name() -> StringName:
if not chase_anim_karaoke.is_empty() and (OS.get_cmdline_user_args().has("--karaoke") or OS.has_environment("karaoke")):
return chase_anim_karaoke
return chase_anim

View File

@ -1,27 +1,32 @@
[gd_scene load_steps=12 format=3 uid="uid://btjepmbw1mq6j"]
[gd_scene load_steps=14 format=3 uid="uid://btjepmbw1mq6j"]
[ext_resource type="PackedScene" uid="uid://8y3swwnmxwg2" path="res://src/core/world/world.tscn" id="1_7hw7e"]
[ext_resource type="Script" uid="uid://dfnb036hysorj" path="res://src/core/world/level/level_loader.gd" id="2_5eifk"]
[ext_resource type="Resource" uid="uid://d0y8d244covqn" path="res://_development/ayuroo/levels/_chase_test/_chase_world_info.tres" id="2_gynur"]
[ext_resource type="Script" uid="uid://3hlvt5k34xva" path="res://src/core/spawnpoint/player_spawn_point.gd" id="3_5eifk"]
[ext_resource type="PackedScene" uid="uid://drr80goa61wrx" path="res://src/core/world/level/level_area.tscn" id="4_clslv"]
[ext_resource type="Script" uid="uid://u2s0spt1rud4" path="res://src/core/game_state_overrider.gd" id="6_gynur"]
[ext_resource type="Script" uid="uid://bfv3de7iqflhv" path="res://src/core/damage/death_area.gd" id="6_tys81"]
[sub_resource type="BoxShape3D" id="BoxShape3D_77q0j"]
size = Vector3(29, 14, 149)
size = Vector3(29, 14, 1582)
[sub_resource type="BoxShape3D" id="BoxShape3D_clslv"]
size = Vector3(29, 14, 1175)
[sub_resource type="BoxShape3D" id="BoxShape3D_gynur"]
size = Vector3(29, 14, 1762)
size = Vector3(29, 14, 1550)
[sub_resource type="BoxShape3D" id="BoxShape3D_vcy7h"]
size = Vector3(14, 14, 17)
[sub_resource type="BoxShape3D" id="BoxShape3D_tys81"]
size = Vector3(1, 2, 0.5)
size = Vector3(1.3000001, 2, 0.5)
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_gynur"]
[node name="ChaseTestWorld" instance=ExtResource("1_7hw7e")]
world_info = ExtResource("2_gynur")
initial_spawn_id = &"Staircase"
debug_spawn_point = &"ChaseInfrontBeginning"
@ -33,13 +38,13 @@ spawn_id = &"Staircase"
metadata/_custom_type_script = "uid://3hlvt5k34xva"
[node name="SpawnInfrontChase" type="Marker3D" parent="Spawnpoints" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, -26)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 4, -26)
script = ExtResource("3_5eifk")
spawn_id = &"ChaseInfrontBeginning"
metadata/_custom_type_script = "uid://3hlvt5k34xva"
[node name="SpawnChaseBeginning" type="Marker3D" parent="Spawnpoints" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, -28)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 4, -28)
script = ExtResource("3_5eifk")
spawn_id = &"ChaseBeginning"
metadata/_custom_type_script = "uid://3hlvt5k34xva"
@ -54,6 +59,16 @@ override_level_id = false
level_id = &"LayoutTest"
metadata/_custom_type_script = "uid://dfnb036hysorj"
[node name="LevelArea" parent="LevelLoaders/LoaderLayoutTest" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
level_loader = NodePath("..")
loaded_if_spawnpoint = [NodePath("../../../Spawnpoints/SpawnStaircase"), NodePath("../../../Spawnpoints/SpawnChaseBeginning"), NodePath("../../../Spawnpoints/SpawnInfrontChase")]
keep_loaded_duration = 2.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelLoaders/LoaderLayoutTest/LevelArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -785.5)
shape = SubResource("BoxShape3D_77q0j")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="LoaderChaseLGTest" type="Marker3D" parent="LevelLoaders" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.5, 3.5, -37.5)
script = ExtResource("2_5eifk")
@ -62,6 +77,16 @@ override_level_id = false
level_id = &"ChaseTest"
metadata/_custom_type_script = "uid://dfnb036hysorj"
[node name="LevelArea" parent="LevelLoaders/LoaderChaseLGTest" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, 37.5)
level_loader = NodePath("..")
loaded_if_spawnpoint = [NodePath("../../../Spawnpoints/SpawnChaseBeginning")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelLoaders/LoaderChaseLGTest/LevelArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -613.54346)
shape = SubResource("BoxShape3D_clslv")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="LoaderChaseEFTest" type="Marker3D" parent="LevelLoaders" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.5, 3.5, -37.5)
script = ExtResource("2_5eifk")
@ -70,39 +95,71 @@ override_level_id = false
level_id = &"ChaseTest"
metadata/_custom_type_script = "uid://dfnb036hysorj"
[node name="LevelAreas" type="Node" parent="." index="2"]
[node name="LevelArea" parent="LevelLoaders/LoaderChaseEFTest" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, 37.5)
level_loader = NodePath("..")
loaded_if_spawnpoint = [NodePath("../../../Spawnpoints/SpawnChaseBeginning")]
[node name="LayoutTestArea" parent="LevelAreas" index="0" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
level_loader = NodePath("../../LevelLoaders/LoaderLayoutTest")
loaded_if_spawnpoint = [NodePath("../../Spawnpoints/SpawnStaircase"), NodePath("../../Spawnpoints/SpawnChaseBeginning"), NodePath("../../Spawnpoints/SpawnInfrontChase")]
keep_loaded_duration = 20.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelAreas/LayoutTestArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -69)
shape = SubResource("BoxShape3D_77q0j")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="ChaseLGArea" parent="LevelAreas" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.5, 0, 0)
level_loader = NodePath("../../LevelLoaders/LoaderChaseLGTest")
loaded_if_spawnpoint = [NodePath("../../Spawnpoints/SpawnChaseBeginning")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelAreas/ChaseLGArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -613.54346)
shape = SubResource("BoxShape3D_clslv")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="ChaseEFArea" parent="LevelAreas" index="2" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.5, 0, 0)
level_loader = NodePath("../../LevelLoaders/LoaderChaseEFTest")
loaded_if_spawnpoint = [NodePath("../../Spawnpoints/SpawnChaseBeginning")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelAreas/ChaseEFArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -907.04346)
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelLoaders/LoaderChaseEFTest/LevelArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -801.04346)
shape = SubResource("BoxShape3D_gynur")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="Checkpoints" type="Node" parent="." index="3"]
[node name="LoaderChaseGNTest" type="Marker3D" parent="LevelLoaders" index="3"]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -12.5, 3.5, -28.5)
script = ExtResource("2_5eifk")
scene_path = "uid://buftkff6aaq04"
override_level_id = false
level_id = &"ChaseTest"
metadata/_custom_type_script = "uid://dfnb036hysorj"
[node name="LevelArea" parent="LevelLoaders/LoaderChaseGNTest" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, 37.5)
level_loader = NodePath("..")
loaded_if_spawnpoint = [NodePath("../../../Spawnpoints/SpawnChaseBeginning")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelLoaders/LoaderChaseGNTest/LevelArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -801.04346)
shape = SubResource("BoxShape3D_gynur")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="LoaderChaseMOTest" type="Marker3D" parent="LevelLoaders" index="4"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.5, -37.5)
script = ExtResource("2_5eifk")
scene_path = "uid://lyl5v6s6waw"
override_level_id = false
level_id = &"ChaseTest"
metadata/_custom_type_script = "uid://dfnb036hysorj"
[node name="LevelArea" parent="LevelLoaders/LoaderChaseMOTest" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, 37.5)
level_loader = NodePath("..")
loaded_if_spawnpoint = [NodePath("../../../Spawnpoints/SpawnChaseBeginning")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelLoaders/LoaderChaseMOTest/LevelArea" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6.5, -801.04346)
shape = SubResource("BoxShape3D_gynur")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="LoaderRhythmTest" type="Marker3D" parent="LevelLoaders" index="5"]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 12.5, 3.5, -29.5)
script = ExtResource("2_5eifk")
scene_path = "uid://7se2e0m4ivcn"
override_level_id = false
level_id = &"ChaseTest"
metadata/_custom_type_script = "uid://dfnb036hysorj"
[node name="LevelArea" parent="LevelLoaders/LoaderRhythmTest" index="1" node_paths=PackedStringArray("level_loader", "loaded_if_spawnpoint") instance=ExtResource("4_clslv")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 29.5, -3.5, -2.000001)
level_loader = NodePath("..")
loaded_if_spawnpoint = [NodePath("../../../Spawnpoints/SpawnChaseBeginning")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="LevelLoaders/LoaderRhythmTest/LevelArea" index="0"]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 3, 6.5, -29.543457)
shape = SubResource("BoxShape3D_vcy7h")
debug_color = Color(1, 1, 0, 0.41960785)
[node name="Checkpoints" type="Node" parent="." index="2"]
[node name="GameStateOverrider" type="Area3D" parent="Checkpoints" index="0" node_paths=PackedStringArray("level_loader", "spawnpoint")]
collision_layer = 0
@ -112,14 +169,13 @@ do_save = false
override_chapter_index = false
level_loader = NodePath("../../LevelLoaders/LoaderLayoutTest")
spawnpoint = NodePath("../../Spawnpoints/SpawnInfrontChase")
use_player_transform = false
metadata/_custom_type_script = "uid://u2s0spt1rud4"
[node name="CollisionShape3D" type="CollisionShape3D" parent="Checkpoints/GameStateOverrider" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, -23.751904)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 5, -28.251904)
shape = SubResource("BoxShape3D_tys81")
[node name="DeathArea" type="Area3D" parent="." index="4"]
[node name="DeathArea" type="Area3D" parent="." index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -7, 0)
collision_layer = 0
collision_mask = 2

View File

@ -2,8 +2,9 @@
[ext_resource type="AudioStream" uid="uid://dxx77jtvkpmdh" path="res://_development/ayuroo/levels/_chase_test/everlasting_fun/Everlasting Fun (Derivative Version) 【INDIGO PARK FAN MUSIC VIDEO.mp3" id="1_prlov"]
[sub_resource type="Animation" id="Animation_tqtrq"]
length = 0.001
[sub_resource type="Animation" id="Animation_lx33g"]
resource_name = "RESET"
step = 0.0427
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
@ -19,48 +20,25 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Saws/Saw:position")
tracks/1/path = NodePath("HeavyBeatVibration:magnitude_multiplier")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0.5, -46)]
"values": [1.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Saws/Saw2:position")
tracks/2/path = NodePath("HeavyBeatVibration:duration")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0.5, -53)]
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("HeavyBeatVibration:magnitude_multiplier")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("HeavyBeatVibration:duration")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.075]
}
@ -3039,6 +3017,6 @@ tracks/5/keys = {
[resource]
_data = {
&"RESET": SubResource("Animation_tqtrq"),
&"RESET": SubResource("Animation_lx33g"),
&"everlasting_fun": SubResource("Animation_uxiet")
}

View File

@ -2,12 +2,12 @@
[ext_resource type="Script" uid="uid://cdgei0ihcem0n" path="res://_development/ayuroo/levels/_chase_test/_chase_test.gd" id="1_ksy85"]
[ext_resource type="AudioStream" uid="uid://bxka3egn4m01r" path="res://_development/ayuroo/levels/_chase_test/tick.ogg" id="2_2frp2"]
[ext_resource type="AnimationLibrary" uid="uid://ct8oebsc01o7j" path="res://_development/ayuroo/levels/_chase_test/everlasting_fun/_ef_chase_anim.tres" id="2_r4hpf"]
[ext_resource type="Script" uid="uid://dp6jy00a6xuhk" path="res://tools/beat_measurer.gd" id="3_c3hig"]
[ext_resource type="AudioStream" uid="uid://bji7bb0rrangg" path="res://_development/ayuroo/levels/_chase_test/tack.ogg" id="3_c4bhh"]
[ext_resource type="AnimationLibrary" uid="uid://ct8oebsc01o7j" path="res://_development/ayuroo/levels/_chase_test/everlasting_fun/_ef_chase_anim.tres" id="4_c4bhh"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="4_gmmry"]
[ext_resource type="PackedScene" uid="uid://c0jearfhlqcvr" path="res://src/gameplay/hazards/saw/saw.tscn" id="5_86lpt"]
[ext_resource type="Script" uid="uid://bueqrebp8o36n" path="res://tools/anim_player_editor_calls.gd" id="5_c4bhh"]
[ext_resource type="Script" uid="uid://jahmwrxb2siw" path="res://tools/timed_music_animationplayer.gd" id="5_c4bhh"]
[ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/vibration_component.gd" id="6_t80us"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2frp2"]
@ -33,7 +33,6 @@ size = Vector3(14, 5, 1)
[node name="ChaseTest" type="Node3D"]
script = ExtResource("1_ksy85")
chase_anim = &"everlasting_fun"
debug_from_marker = &"IntroEnd"
bpm = 176.0
metadata/_custom_type_script = "uid://cigop0ivp5vvu"
@ -54,12 +53,19 @@ audio_max_polyphony = 1
callback_mode_process = 0
callback_mode_method = 1
libraries = {
&"": ExtResource("2_r4hpf")
&"": ExtResource("4_c4bhh")
}
script = ExtResource("5_c4bhh")
audio_player = NodePath("../Music")
metadata/_custom_type_script = "uid://jahmwrxb2siw"
[node name="CameraRoot" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -1031.8802)
[node name="Camera3D" type="Camera3D" parent="CameraRoot"]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 2, 0, 0)
fov = 37.38998
[node name="ProgressTrack" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
curve = SubResource("Curve3D_tqtrq")
@ -71,6 +77,10 @@ loop = false
[node name="DebugVisualizer" type="MeshInstance3D" parent="ProgressTrack/PlayerDesiredProgress"]
mesh = SubResource("SphereMesh_tqtrq")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="ProgressTrack/PlayerDesiredProgress/DebugVisualizer"]
remote_path = NodePath("../../../../CameraRoot")
update_scale = false
[node name="BeatMeasurer" type="Node" parent="ProgressTrack" node_paths=PackedStringArray("path")]
script = ExtResource("3_c3hig")
path = NodePath("..")
@ -101,9 +111,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -53)
script = ExtResource("6_t80us")
duration = 0.075
sync_to_audio = true
weak_magnitude = 0.25
weak_magnitude = 0.75
strong_magnitude = 0.5
magnitude_multiplier = 0.0
weak_controller_duration_multiplier = 1.5
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="LightBeatVibration" type="Node" parent="."]
@ -122,5 +132,10 @@ collision_mask = 2
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
shape = SubResource("BoxShape3D_gsfaw")
[connection signal="started_vibration" from="HeavyBeatVibration" to="Beat" method="play"]
[node name="_DEV_LABEL" type="Label3D" parent="."]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 6, 2, -3)
text = "If the audio and anim desync and cause the player to slow down,
set the follower up, so that it always stays at a certain
distance from the PlayerDesiredProgress ball/point/marker."
[connection signal="body_entered" from="StartChaseArea" to="." method="_on_start_chase_area_body_entered"]

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://bqxw00b4hjpll"
path="res://.godot/imported/Good Enough (Karaoke w Backup Vocals) ft. @Jakeneutron.mp3-2d43ab72d2f01668a47518fd14193562.mp3str"
[deps]
source_file="res://_development/ayuroo/levels/_chase_test/good_enough/Good Enough (Karaoke w Backup Vocals) ft. @Jakeneutron.mp3"
dest_files=["res://.godot/imported/Good Enough (Karaoke w Backup Vocals) ft. @Jakeneutron.mp3-2d43ab72d2f01668a47518fd14193562.mp3str"]
[params]
loop=false
loop_offset=0.0
bpm=97.0
beat_count=0
bar_beats=4

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://b6kgg4bkxmcd7"
path="res://.godot/imported/Good Enough (feat. @KittenSneeze, @Cami-Cat, @bbyamm @longestsoloever, @OtterBoyVA) [AUDIO ONLY].mp3-2438e6dffa732e3bd1b6c0d3e17d0203.mp3str"
[deps]
source_file="res://_development/ayuroo/levels/_chase_test/good_enough/Good Enough (feat. @KittenSneeze, @Cami-Cat, @bbyamm @longestsoloever, @OtterBoyVA) [AUDIO ONLY].mp3"
dest_files=["res://.godot/imported/Good Enough (feat. @KittenSneeze, @Cami-Cat, @bbyamm @longestsoloever, @OtterBoyVA) [AUDIO ONLY].mp3-2438e6dffa732e3bd1b6c0d3e17d0203.mp3str"]
[params]
loop=false
loop_offset=0.0
bpm=97.0
beat_count=0
bar_beats=4

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://cdo7ced2107jq"
path="res://.godot/imported/Good Enough.mp3-347afbf64f6e84f9dfdc7d5768f45c89.mp3str"
[deps]
source_file="res://_development/ayuroo/levels/_chase_test/good_enough/Good Enough.mp3"
dest_files=["res://.godot/imported/Good Enough.mp3-347afbf64f6e84f9dfdc7d5768f45c89.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -0,0 +1,142 @@
[gd_scene load_steps=14 format=3 uid="uid://buftkff6aaq04"]
[ext_resource type="Script" uid="uid://cdgei0ihcem0n" path="res://_development/ayuroo/levels/_chase_test/_chase_test.gd" id="1_sm484"]
[ext_resource type="AudioStream" uid="uid://bxka3egn4m01r" path="res://_development/ayuroo/levels/_chase_test/tick.ogg" id="2_so850"]
[ext_resource type="AudioStream" uid="uid://bji7bb0rrangg" path="res://_development/ayuroo/levels/_chase_test/tack.ogg" id="3_wpnkt"]
[ext_resource type="AnimationLibrary" uid="uid://dfgpkxgfyo5h1" path="res://_development/ayuroo/levels/_chase_test/good_enough/anim_good_enough.tres" id="4_ikio2"]
[ext_resource type="Script" uid="uid://jahmwrxb2siw" path="res://tools/timed_music_animationplayer.gd" id="5_uc6ca"]
[ext_resource type="Script" uid="uid://dp6jy00a6xuhk" path="res://tools/beat_measurer.gd" id="6_suojm"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="7_6fa34"]
[ext_resource type="PackedScene" uid="uid://c0jearfhlqcvr" path="res://src/gameplay/hazards/saw/saw.tscn" id="8_5k2no"]
[ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/vibration_component.gd" id="9_u4bqw"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2frp2"]
playback_mode = 2
streams_count = 2
stream_0/stream = ExtResource("2_so850")
stream_1/stream = ExtResource("3_wpnkt")
[sub_resource type="Curve3D" id="Curve3D_tqtrq"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1533),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="SphereMesh" id="SphereMesh_tqtrq"]
radius = 0.15
height = 0.3
[sub_resource type="BoxShape3D" id="BoxShape3D_gsfaw"]
size = Vector3(14, 5, 1)
[node name="ChaseTest" type="Node3D"]
script = ExtResource("1_sm484")
chase_anim = &"good_enough"
chase_anim_karaoke = &"good_enough_karaoke"
bpm = 195.0
metadata/_custom_type_script = "uid://cigop0ivp5vvu"
[node name="Music" type="AudioStreamPlayer" parent="."]
volume_db = -4.5
[node name="Beat" type="AudioStreamPlayer" parent="."]
stream = SubResource("AudioStreamRandomizer_2frp2")
volume_db = -3.0
max_polyphony = 4
[node name="Bar" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_wpnkt")
volume_db = -6.0
[node name="MusicAnimation" type="AnimationPlayer" parent="."]
audio_max_polyphony = 1
callback_mode_process = 0
callback_mode_method = 1
libraries = {
&"": ExtResource("4_ikio2")
}
script = ExtResource("5_uc6ca")
audio_player = NodePath("../Music")
metadata/_custom_type_script = "uid://jahmwrxb2siw"
[node name="CameraRoot" type="Node3D" parent="."]
transform = Transform3D(0.99999887, 0, 0, 0, 0.99999887, 0, 0, 0, 0.99999887, 0, 1, 0)
[node name="Camera3D" type="Camera3D" parent="CameraRoot"]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 2, 0, 0)
fov = 37.38998
[node name="ProgressTrack" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
curve = SubResource("Curve3D_tqtrq")
[node name="PlayerDesiredProgress" type="PathFollow3D" parent="ProgressTrack"]
rotation_mode = 0
loop = false
[node name="DebugVisualizer" type="MeshInstance3D" parent="ProgressTrack/PlayerDesiredProgress"]
mesh = SubResource("SphereMesh_tqtrq")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="ProgressTrack/PlayerDesiredProgress/DebugVisualizer"]
remote_path = NodePath("../../../../CameraRoot")
update_scale = false
[node name="BeatMeasurer" type="Node" parent="ProgressTrack" node_paths=PackedStringArray("path")]
script = ExtResource("6_suojm")
path = NodePath("..")
track_duration = 290.06
track_bpm = 176
metadata/_custom_type_script = "uid://dp6jy00a6xuhk"
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
use_collision = true
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -767.75)
size = Vector3(14, 1, 1536.5)
material = ExtResource("7_6fa34")
[node name="Saws" type="Node3D" parent="."]
[node name="ResetSaw" parent="Saws" instance=ExtResource("8_5k2no")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 1, -1511.1943)
[node name="Saw" parent="Saws" instance=ExtResource("8_5k2no")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -46)
[node name="Saw2" parent="Saws" instance=ExtResource("8_5k2no")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -53)
[node name="HeavyBeatVibration" type="Node" parent="."]
script = ExtResource("9_u4bqw")
duration = 0.09
sync_to_audio = true
weak_magnitude = 0.575
strong_magnitude = 0.75
weak_controller_duration_multiplier = 1.5
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="LightBeatVibration" type="Node" parent="."]
script = ExtResource("9_u4bqw")
duration = 0.075
sync_to_audio = true
weak_magnitude = 0.375
strong_magnitude = 0.0
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="StartChaseArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="StartChaseArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
shape = SubResource("BoxShape3D_gsfaw")
[node name="_DEV_LABEL" type="Label3D" parent="."]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 6, 2, -3)
text = "If the audio and anim desync and cause the player to slow down,
set the follower up, so that it always stays at a certain
distance from the PlayerDesiredProgress ball/point/marker."
[connection signal="body_entered" from="StartChaseArea" to="." method="_on_start_chase_area_body_entered"]

File diff suppressed because one or more lines are too long

View File

@ -91,7 +91,7 @@ tracks/3/path = NodePath("Saws/Saw2:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(9, 9.2),
"times": PackedFloat32Array(8.6, 8.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, -1, -53), Vector3(0, 0.5, -53)]

View File

@ -6,8 +6,8 @@
[ext_resource type="Script" uid="uid://dp6jy00a6xuhk" path="res://tools/beat_measurer.gd" id="3_pwoi6"]
[ext_resource type="AudioStream" uid="uid://bycnxkxch1dmo" path="res://_development/ayuroo/levels/_chase_test/bar.ogg" id="3_ytnb7"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="4_ytnb7"]
[ext_resource type="Script" uid="uid://bueqrebp8o36n" path="res://tools/anim_player_editor_calls.gd" id="5_1cy10"]
[ext_resource type="PackedScene" uid="uid://c0jearfhlqcvr" path="res://src/gameplay/hazards/saw/saw.tscn" id="5_i68vn"]
[ext_resource type="Script" uid="uid://jahmwrxb2siw" path="res://tools/timed_music_animationplayer.gd" id="5_ytnb7"]
[ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/vibration_component.gd" id="6_1cy10"]
[sub_resource type="Curve3D" id="Curve3D_tqtrq"]
@ -45,7 +45,9 @@ callback_mode_process = 0
libraries = {
&"": ExtResource("2_kddul")
}
script = ExtResource("5_1cy10")
script = ExtResource("5_ytnb7")
audio_player = NodePath("../Music")
metadata/_custom_type_script = "uid://jahmwrxb2siw"
[node name="ProgressTrack" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
@ -87,7 +89,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -53)
[node name="VibrationComponent" type="Node" parent="."]
script = ExtResource("6_1cy10")
duration = 0.1
editor_delay = 0.125
sync_to_audio = true
weak_magnitude = 0.25
strong_magnitude = 0.5

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://du3mds6gp7awe"
path="res://.godot/imported/Maestro.mp3-84933deddf14ac0571897a97f8b07420.mp3str"
[deps]
source_file="res://_development/ayuroo/levels/_chase_test/maestro/Maestro.mp3"
dest_files=["res://.godot/imported/Maestro.mp3-84933deddf14ac0571897a97f8b07420.mp3str"]
[params]
loop=true
loop_offset=0.0
bpm=160.0
beat_count=0
bar_beats=4

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,142 @@
[gd_scene load_steps=14 format=3 uid="uid://lyl5v6s6waw"]
[ext_resource type="Script" uid="uid://cdgei0ihcem0n" path="res://_development/ayuroo/levels/_chase_test/_chase_test.gd" id="1_ce4yl"]
[ext_resource type="AudioStream" uid="uid://bxka3egn4m01r" path="res://_development/ayuroo/levels/_chase_test/tick.ogg" id="2_v5aaa"]
[ext_resource type="AudioStream" uid="uid://bji7bb0rrangg" path="res://_development/ayuroo/levels/_chase_test/tack.ogg" id="3_kbj6i"]
[ext_resource type="AnimationLibrary" uid="uid://dhcvtj55pdbi0" path="res://_development/ayuroo/levels/_chase_test/maestro/_mo_anim.tres" id="4_q2x38"]
[ext_resource type="Script" uid="uid://jahmwrxb2siw" path="res://tools/timed_music_animationplayer.gd" id="5_5dvgd"]
[ext_resource type="Script" uid="uid://dp6jy00a6xuhk" path="res://tools/beat_measurer.gd" id="6_hltqc"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="7_6lemm"]
[ext_resource type="PackedScene" uid="uid://c0jearfhlqcvr" path="res://src/gameplay/hazards/saw/saw.tscn" id="8_lca1p"]
[ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/vibration_component.gd" id="9_yut28"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2frp2"]
playback_mode = 2
streams_count = 2
stream_0/stream = ExtResource("2_v5aaa")
stream_1/stream = ExtResource("3_kbj6i")
[sub_resource type="Curve3D" id="Curve3D_tqtrq"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -897),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="SphereMesh" id="SphereMesh_tqtrq"]
radius = 0.15
height = 0.3
[sub_resource type="BoxShape3D" id="BoxShape3D_gsfaw"]
size = Vector3(14, 5, 1)
[node name="ChaseTest" type="Node3D"]
script = ExtResource("1_ce4yl")
chase_anim = &"maestro"
metadata/_custom_type_script = "uid://cigop0ivp5vvu"
[node name="Music" type="AudioStreamPlayer" parent="."]
volume_db = -4.5
[node name="Beat" type="AudioStreamPlayer" parent="."]
stream = SubResource("AudioStreamRandomizer_2frp2")
volume_db = -3.0
max_polyphony = 4
[node name="Bar" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_kbj6i")
volume_db = -6.0
[node name="MusicAnimation" type="AnimationPlayer" parent="."]
audio_max_polyphony = 1
callback_mode_process = 0
callback_mode_method = 1
libraries = {
&"": ExtResource("4_q2x38")
}
script = ExtResource("5_5dvgd")
audio_player = NodePath("../Music")
metadata/_custom_type_script = "uid://jahmwrxb2siw"
[node name="CameraRoot" type="Node3D" parent="."]
transform = Transform3D(0.99999887, 0, 0, 0, 0.99999887, 0, 0, 0, 0.99999887, 0, 1, -897)
[node name="Camera3D" type="Camera3D" parent="CameraRoot"]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 2, 0, 0)
fov = 37.38998
[node name="ProgressTrack" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
curve = SubResource("Curve3D_tqtrq")
[node name="PlayerDesiredProgress" type="PathFollow3D" parent="ProgressTrack"]
rotation_mode = 0
loop = false
[node name="DebugVisualizer" type="MeshInstance3D" parent="ProgressTrack/PlayerDesiredProgress"]
mesh = SubResource("SphereMesh_tqtrq")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="ProgressTrack/PlayerDesiredProgress/DebugVisualizer"]
remote_path = NodePath("../../../../CameraRoot")
update_scale = false
[node name="BeatMeasurer" type="Node" parent="ProgressTrack" node_paths=PackedStringArray("path")]
script = ExtResource("6_hltqc")
path = NodePath("..")
track_duration = 290.06
track_bpm = 176
metadata/_custom_type_script = "uid://dp6jy00a6xuhk"
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
use_collision = true
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -450)
size = Vector3(14, 1, 901)
material = ExtResource("7_6lemm")
[node name="Saws" type="Node3D" parent="."]
[node name="ResetSaw" parent="Saws" instance=ExtResource("8_lca1p")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 1, -896.19434)
[node name="Saw" parent="Saws" instance=ExtResource("8_lca1p")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -46)
[node name="Saw2" parent="Saws" instance=ExtResource("8_lca1p")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -53)
[node name="HeavyBeatVibration" type="Node" parent="."]
script = ExtResource("9_yut28")
duration = 0.1
sync_to_audio = true
weak_magnitude = 0.575
strong_magnitude = 0.75
weak_controller_magnitude_multiplier = 1.5
weak_controller_duration_multiplier = 1.25
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="LightBeatVibration" type="Node" parent="."]
script = ExtResource("9_yut28")
duration = 0.175
sync_to_audio = true
weak_magnitude = 0.375
strong_magnitude = 0.0
weak_controller_magnitude_multiplier = 1.75
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="StartChaseArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="StartChaseArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
shape = SubResource("BoxShape3D_gsfaw")
[node name="_DEV_LABEL" type="Label3D" parent="."]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 6, 2, -3)
text = "If the audio and anim desync and cause the player to slow down,
set the follower up, so that it always stays at a certain
distance from the PlayerDesiredProgress ball/point/marker."
[connection signal="body_entered" from="StartChaseArea" to="." method="_on_start_chase_area_body_entered"]

View File

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://cwpx80o5yaauf"
path="res://.godot/imported/120bpm_beat.ogg-0962ec5100a97c7393d43714eea8b62e.oggvorbisstr"
[deps]
source_file="res://_development/ayuroo/levels/_chase_test/rhythm_test/120bpm_beat.ogg"
dest_files=["res://.godot/imported/120bpm_beat.ogg-0962ec5100a97c7393d43714eea8b62e.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -0,0 +1,647 @@
[gd_scene load_steps=21 format=3 uid="uid://7se2e0m4ivcn"]
[ext_resource type="Script" uid="uid://cdgei0ihcem0n" path="res://_development/ayuroo/levels/_chase_test/_chase_test.gd" id="1_td1ny"]
[ext_resource type="AudioStream" uid="uid://bxka3egn4m01r" path="res://_development/ayuroo/levels/_chase_test/tick.ogg" id="2_hqvl2"]
[ext_resource type="AudioStream" uid="uid://bji7bb0rrangg" path="res://_development/ayuroo/levels/_chase_test/tack.ogg" id="3_gkp73"]
[ext_resource type="AudioStream" uid="uid://cwpx80o5yaauf" path="res://_development/ayuroo/levels/_chase_test/rhythm_test/120bpm_beat.ogg" id="4_rv68v"]
[ext_resource type="Script" uid="uid://jahmwrxb2siw" path="res://tools/timed_music_animationplayer.gd" id="5_qnmws"]
[ext_resource type="Script" uid="uid://dp6jy00a6xuhk" path="res://tools/beat_measurer.gd" id="6_6tlon"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="7_xcut5"]
[ext_resource type="PackedScene" uid="uid://c0jearfhlqcvr" path="res://src/gameplay/hazards/saw/saw.tscn" id="8_burxb"]
[ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/vibration_component.gd" id="9_k4kf7"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2frp2"]
playback_mode = 2
streams_count = 2
stream_0/stream = ExtResource("2_hqvl2")
stream_1/stream = ExtResource("3_gkp73")
[sub_resource type="Animation" id="Animation_lx33g"]
resource_name = "RESET"
step = 0.0427
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ProgressTrack/PlayerDesiredProgress:progress_ratio")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_uxiet"]
resource_name = "rhythm_test"
length = 60.0
loop_mode = 1
step = 0.5
markers = [{
"color": Color(1, 1, 1, 1),
"name": &"Intro",
"time": 0.0
}, {
"color": Color(1, 1, 1, 1),
"name": &"HalfTime",
"time": 30.120914
}]
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Music")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("4_rv68v")
}],
"times": PackedFloat32Array(0)
}
tracks/0/use_blend = true
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ProgressTrack/PlayerDesiredProgress:progress_ratio")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 60),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("LightBeatVibration")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.5, 1, 1.5, 2.5, 3, 3.5, 4.5, 5, 5.5, 6.5, 7, 7.5, 8.5, 9, 9.5, 10.5, 11, 11.5, 12.5, 13, 13.5, 14.5, 15, 15.5, 16.5, 17, 17.5, 18.5, 19, 19.5, 20.5, 21, 21.5, 22.5, 23, 23.5, 24.5, 25, 25.5, 26.5, 27, 27.5, 28.5, 29, 29.5, 30.5, 31, 31.5, 32.5, 33, 33.5, 34.5, 35, 35.5, 36.5, 37, 37.5, 38.5, 39, 39.5, 40.5, 41, 41.5, 42.5, 43, 43.5, 44.5, 45, 45.5, 46.5, 47, 47.5, 48.5, 49, 49.5, 50.5, 51, 51.5, 52.5, 53, 53.5, 54.5, 55, 55.5, 56.5, 57, 57.5, 58.5, 59, 59.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}]
}
tracks/3/type = "method"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("HeavyBeatVibration")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}, {
"args": [],
"method": &"vibrate"
}]
}
tracks/4/type = "animation"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Saws/Saw/SawAnimation")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"clips": PackedStringArray("saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in", "saw_out", "saw_in"),
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5, 24, 24.5, 25, 25.5, 26, 26.5, 27, 27.5, 28, 28.5, 29, 29.5, 30, 30.5, 31, 31.5, 32, 32.5, 33, 33.5, 34, 34.5, 35, 35.5, 36, 36.5, 37, 37.5, 38, 38.5, 39, 39.5, 40, 40.5, 41, 41.5, 42, 42.5, 43, 43.5, 44, 44.5, 45, 45.5, 46, 46.5, 47, 47.5, 48, 48.5, 49, 49.5, 50, 50.5, 51, 51.5, 52, 52.5, 53, 53.5, 54, 54.5, 55, 55.5, 56, 56.5, 57, 57.5, 58, 58.5, 59, 59.5, 60)
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_4gsqv"]
_data = {
&"RESET": SubResource("Animation_lx33g"),
&"rhythm_test": SubResource("Animation_uxiet")
}
[sub_resource type="Curve3D" id="Curve3D_tqtrq"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="SphereMesh" id="SphereMesh_tqtrq"]
radius = 0.15
height = 0.3
[sub_resource type="Animation" id="Animation_4gsqv"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Saws/Saw:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(3, 0.5, -11)]
}
[sub_resource type="Animation" id="Animation_rv68v"]
resource_name = "saw_in"
length = 0.15
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Saws/Saw:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.15),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(3, 0.5, -11), Vector3(3, -0.75, -11)]
}
[sub_resource type="Animation" id="Animation_t4ew6"]
resource_name = "saw_out"
length = 0.15
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Saws/Saw:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.15),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(3, -0.75, -11), Vector3(3, 0.5, -11)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_f8t6g"]
_data = {
&"RESET": SubResource("Animation_4gsqv"),
&"saw_in": SubResource("Animation_rv68v"),
&"saw_out": SubResource("Animation_t4ew6")
}
[sub_resource type="BoxShape3D" id="BoxShape3D_gsfaw"]
size = Vector3(14, 5, 1)
[node name="ChaseTest" type="Node3D"]
script = ExtResource("1_td1ny")
chase_anim = &"rhythm_test"
bpm = 120.0
metadata/_custom_type_script = "uid://cigop0ivp5vvu"
[node name="Music" type="AudioStreamPlayer" parent="."]
volume_db = -6.0
[node name="Beat" type="AudioStreamPlayer" parent="."]
stream = SubResource("AudioStreamRandomizer_2frp2")
volume_db = -3.0
max_polyphony = 4
[node name="Bar" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_gkp73")
volume_db = -6.0
[node name="MusicAnimation" type="AnimationPlayer" parent="."]
audio_max_polyphony = 1
callback_mode_process = 0
callback_mode_method = 1
libraries = {
&"": SubResource("AnimationLibrary_4gsqv")
}
script = ExtResource("5_qnmws")
audio_player = NodePath("../Music")
metadata/_custom_type_script = "uid://jahmwrxb2siw"
[node name="CameraRoot" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="Camera3D" type="Camera3D" parent="CameraRoot"]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 2, 0, 0)
fov = 37.38998
[node name="ProgressTrack" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
curve = SubResource("Curve3D_tqtrq")
[node name="PlayerDesiredProgress" type="PathFollow3D" parent="ProgressTrack"]
rotation_mode = 0
loop = false
[node name="DebugVisualizer" type="MeshInstance3D" parent="ProgressTrack/PlayerDesiredProgress"]
mesh = SubResource("SphereMesh_tqtrq")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="ProgressTrack/PlayerDesiredProgress/DebugVisualizer"]
remote_path = NodePath("../../../../CameraRoot")
update_scale = false
[node name="BeatMeasurer" type="Node" parent="ProgressTrack" node_paths=PackedStringArray("path")]
script = ExtResource("6_6tlon")
path = NodePath("..")
track_duration = 290.06
track_bpm = 176
metadata/_custom_type_script = "uid://dp6jy00a6xuhk"
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
use_collision = true
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -6.5)
size = Vector3(14, 1, 14)
material = ExtResource("7_xcut5")
[node name="Saws" type="Node3D" parent="."]
[node name="Saw" parent="Saws" instance=ExtResource("8_burxb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0.5, -11)
[node name="SawAnimation" type="AnimationPlayer" parent="Saws/Saw"]
root_node = NodePath("../../..")
audio_max_polyphony = 1
callback_mode_process = 0
callback_mode_method = 1
libraries = {
&"": SubResource("AnimationLibrary_f8t6g")
}
[node name="HeavyBeatVibration" type="Node" parent="."]
script = ExtResource("9_k4kf7")
duration = 0.1
sync_to_audio = true
weak_magnitude = 0.25
strong_magnitude = 0.5
weak_controller_duration_multiplier = 1.5
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="LightBeatVibration" type="Node" parent="."]
script = ExtResource("9_k4kf7")
duration = 0.1
sync_to_audio = true
strong_magnitude = 0.125
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="StartChaseArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="StartChaseArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
shape = SubResource("BoxShape3D_gsfaw")
[connection signal="body_entered" from="StartChaseArea" to="." method="_on_start_chase_area_body_entered"]

View File

@ -8,3 +8,4 @@ albedo_texture = ExtResource("1_pfrvh")
roughness = 0.5
uv1_scale = Vector3(2, 2, 1)
uv1_offset = Vector3(0, -1, 0)
texture_filter = 5

View File

@ -8,3 +8,4 @@ albedo_texture = ExtResource("1_67eg5")
roughness = 0.5
uv1_scale = Vector3(2, 2, 1)
uv1_offset = Vector3(0, -1, 0)
texture_filter = 5

View File

@ -8,3 +8,4 @@ albedo_texture = ExtResource("1_vv0ty")
roughness = 0.5
uv1_scale = Vector3(2, 2, 1)
uv1_offset = Vector3(0, -1, 0)
texture_filter = 5

View File

@ -8,3 +8,4 @@ albedo_texture = ExtResource("1_8tkn2")
roughness = 0.97
uv1_scale = Vector3(2, 2, 1)
uv1_offset = Vector3(0, -1, 0)
texture_filter = 5

View File

@ -8,3 +8,4 @@ albedo_texture = ExtResource("1_gjyc6")
roughness = 0.97
uv1_scale = Vector3(2, 2, 1)
uv1_offset = Vector3(0, -1, 0)
texture_filter = 5

View File

@ -4,9 +4,3 @@
[resource]
script = ExtResource("1")
joypad_fallback = 9
joypad_deadzone = 0.5
allow_mouse_remap = true
mouse_min_movement = 200
custom_asset_dir = ""
custom_file_extension = ""

View File

@ -108,17 +108,17 @@ func _update_hud() -> void:
var text: String = ""
if not msg_list.is_empty():
text = "[color=%s]=== Normal Logs ===\n" %TYPE_TITLE_COLOR
text = "[color=%s]===[ Normal Logs ]===\n" % TYPE_TITLE_COLOR
text += "\n".join(msg_list) if not msg_list.is_empty() else "" # first regular messages.
text += "\n"
if not msgf_list.is_empty():
text += "[color=%s]=== Frame-Logs ===\n" %TYPE_TITLE_COLOR
text += "[color=%s]===[ Frame-Logs ]===\n" % TYPE_TITLE_COLOR
text += "\n".join(msgf_list) if not msgf_list.is_empty() else "" # frame messages afterwards.
text += "\n"
if not msgpf_list.is_empty():
text += "[color=%s]=== Physics-Frame-Logs ===\n" %TYPE_TITLE_COLOR
text += "[color=%s]===[ Physics-Frame-Logs ]===\n" % TYPE_TITLE_COLOR
text += "\n".join(msgpf_list) if not msgpf_list.is_empty() else "" # and now physics frames.
log_label.set_text(text)

View File

@ -3,7 +3,9 @@ extends CanvasLayer
const DEFAULT_TEXT: String = "{game_name} - {state} - V - {version}"
const UNDEFINED_TEXT: String = "Undefined"
@export_enum("Pre-Production", "Pre-Alpha", "Early-Alpha", "Alpha", "Beta", "Early-Access", "Release") var state: String = "Pre-Alpha"
const States: String = "Pre-Production,Pre-Alpha,Early-Alpha,Alpha,Beta,Early-Access,Release"
@export_custom(PROPERTY_HINT_ENUM_SUGGESTION, States) var state: String = "Pre-Production"
@export_multiline var text_override: String = DEFAULT_TEXT: set = set_text
@onready var version_label: Label = $MarginContainer/VersionLabel

View File

@ -7,7 +7,6 @@ process_mode = 3
layer = 64
follow_viewport_enabled = true
script = ExtResource("1_jk1t8")
state = "Pre-Production"
[node name="MarginContainer" type="MarginContainer" parent="."]
anchors_preset = 15

View File

@ -16,3 +16,4 @@ heightmap_deep_parallax = true
heightmap_min_layers = 8
heightmap_max_layers = 32
heightmap_texture = ExtResource("4")
texture_filter = 5

View File

@ -6,3 +6,4 @@
albedo_texture = ExtResource("1_38xbi")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://olxux7okrb2b"]
[ext_resource type="Texture2D" uid="uid://c8a1v7bw3jjca" path="res://addons/kenney_prototype_textures/dark/texture_02.png" id="1_jl162"]
[ext_resource type="Texture2D" uid="uid://c8a1v7bw3jjca" path="res://assets/materials/dev/dark/texture_02.png" id="1_jl162"]
[resource]
albedo_texture = ExtResource("1_jl162")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://blkew2hja11cj"]
[ext_resource type="Texture2D" uid="uid://crgcp76xdixb" path="res://addons/kenney_prototype_textures/dark/texture_03.png" id="1_t7bo5"]
[ext_resource type="Texture2D" uid="uid://crgcp76xdixb" path="res://assets/materials/dev/dark/texture_03.png" id="1_t7bo5"]
[resource]
albedo_texture = ExtResource("1_t7bo5")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://biu40ot7f55no"]
[ext_resource type="Texture2D" uid="uid://djftxgnhedhk2" path="res://addons/kenney_prototype_textures/dark/texture_05.png" id="1_l8w0p"]
[ext_resource type="Texture2D" uid="uid://djftxgnhedhk2" path="res://assets/materials/dev/dark/texture_05.png" id="1_l8w0p"]
[resource]
albedo_texture = ExtResource("1_l8w0p")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -6,3 +6,4 @@
albedo_texture = ExtResource("1_c2346")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bahys2ntbh2ap"]
[ext_resource type="Texture2D" uid="uid://g26nr5u8081t" path="res://addons/kenney_prototype_textures/orange/texture_01.png" id="1_vb3n0"]
[ext_resource type="Texture2D" uid="uid://g26nr5u8081t" path="res://assets/materials/dev/orange/texture_01.png" id="1_vb3n0"]
[resource]
albedo_texture = ExtResource("1_vb3n0")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://r527wj0qbkvs"]
[ext_resource type="Texture2D" uid="uid://12e0onm52r6b" path="res://addons/kenney_prototype_textures/orange/texture_02.png" id="1_4qkig"]
[ext_resource type="Texture2D" uid="uid://12e0onm52r6b" path="res://assets/materials/dev/orange/texture_02.png" id="1_4qkig"]
[resource]
albedo_texture = ExtResource("1_4qkig")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://diwfj3ywaniq5"]
[ext_resource type="Texture2D" uid="uid://eemth84vpstv" path="res://addons/kenney_prototype_textures/orange/texture_03.png" id="1_fipy7"]
[ext_resource type="Texture2D" uid="uid://eemth84vpstv" path="res://assets/materials/dev/orange/texture_03.png" id="1_fipy7"]
[resource]
albedo_texture = ExtResource("1_fipy7")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bwbwqb84pmji3"]
[ext_resource type="Texture2D" uid="uid://bgj70nov05sqo" path="res://addons/kenney_prototype_textures/orange/texture_04.png" id="1_mje5s"]
[ext_resource type="Texture2D" uid="uid://bgj70nov05sqo" path="res://assets/materials/dev/orange/texture_04.png" id="1_mje5s"]
[resource]
albedo_texture = ExtResource("1_mje5s")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,8 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://d02jll28bgkap"]
[ext_resource type="Texture2D" uid="uid://5erjqyy4c7xn" path="res://addons/kenney_prototype_textures/orange/texture_05.png" id="1_phgo0"]
[ext_resource type="Texture2D" uid="uid://5erjqyy4c7xn" path="res://assets/materials/dev/orange/texture_05.png" id="1_phgo0"]
[resource]
albedo_texture = ExtResource("1_phgo0")
uv1_triplanar = true
uv1_world_triplanar = true
texture_filter = 5

View File

@ -1,13 +0,0 @@
[gd_resource type="StandardMaterial3D" load_steps=5 format=2]
[ext_resource path="Glass_albedo.png" type="Texture" id=1]
[ext_resource path="Glass_orm.png" type="Texture" id=2]
[resource]
albedo_color = Color(1.0, 1.0, 1.0, 1.0)
albedo_texture = ExtResource( 1 )
metallic = 1.0
roughness = 0.7
roughness_texture = ExtResource( 2 )
roughness_texture_channel = 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@ -3,3 +3,4 @@
[resource]
albedo_color = Color(0.1148968, 0.11489681, 0.1148968, 1)
roughness = 0.85
texture_filter = 0

Binary file not shown.

View File

@ -0,0 +1,42 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b1ax1psf37ets"
path="res://.godot/imported/godot_plush_sitting.glb-0976f26961774533aed945988fb919e5.scn"
[deps]
source_file="res://assets/models/plush/godot_plush_sitting.glb"
dest_files=["res://.godot/imported/godot_plush_sitting.glb-0976f26961774533aed945988fb919e5.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=0
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=true
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
gltf/naming_version=2
gltf/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 MiB

View File

@ -2,17 +2,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cjdn0al3k5sr1"
path.s3tc="res://.godot/imported/Glass_albedo.png-11a38e2ea0392d99b9c5666124e14317.s3tc.ctex"
uid="uid://byxam2d0pahu0"
path.s3tc="res://.godot/imported/godot_plush_sitting_godot_plush_basecolor.png-19716d1f5e2e4071807f25506ccd05d8.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "6aa88ad35f2cb7798263bd4925888e7b"
}
[deps]
source_file="res://assets/models/electrics/Glass_albedo.png"
dest_files=["res://.godot/imported/Glass_albedo.png-11a38e2ea0392d99b9c5666124e14317.s3tc.ctex"]
source_file="res://assets/models/plush/godot_plush_sitting_godot_plush_basecolor.png"
dest_files=["res://.godot/imported/godot_plush_sitting_godot_plush_basecolor.png-19716d1f5e2e4071807f25506ccd05d8.s3tc.ctex"]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://6e6jhxo8507x"
path.s3tc="res://.godot/imported/godot_plush_sitting_godot_plush_normal.png-29b0a51fe8f67cea2d5bc3d37b9885e9.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "33ac1a9f1eac7545987cebf825968bea"
}
[deps]
source_file="res://assets/models/plush/godot_plush_sitting_godot_plush_normal.png"
dest_files=["res://.godot/imported/godot_plush_sitting_godot_plush_normal.png-29b0a51fe8f67cea2d5bc3d37b9885e9.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://assets/models/plush/godot_plush_sitting_godot_plush_normal.png"
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dx8dnt87dovdm"
path.s3tc="res://.godot/imported/godot_plush_sitting_godot_plush_roughness.png-c986f129af18223c92dbf964e18255cb.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "53e8d52887ded32d898767cc245cc96a"
}
[deps]
source_file="res://assets/models/plush/godot_plush_sitting_godot_plush_roughness.png"
dest_files=["res://.godot/imported/godot_plush_sitting_godot_plush_roughness.png-c986f129af18223c92dbf964e18255cb.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

BIN
source/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

3
source/icon.png.import Normal file
View File

@ -0,0 +1,3 @@
[remap]
importer="skip"

View File

@ -22,7 +22,7 @@ SettingsManager="*res://src/globals/autoloads/settings/settings_manager.gd"
SceneFader="*res://src/globals/autoloads/scene_fader/scene_fader.tscn"
GameGlobals="*res://src/globals/autoloads/game_globals.gd"
InputManager="*res://src/globals/autoloads/input_manager.gd"
SaveManager="*res://src/globals/autoloads/save_manager/save_manager.gd"
SaveManager="*res://src/globals/autoloads/save_manager/save_manager.tscn"
AudioManager="*res://src/globals/autoloads/audio/audio_manager.tscn"
Logger="*res://addons/logger/logger.tscn"
VersionDisplay="*res://addons/version_display/version_display.tscn"
@ -119,9 +119,16 @@ jump={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
]
}
toggle_mouse={
crouch={
"deadzone": 0.2,
"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":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
"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":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null)
]
}
interact={
"deadzone": 0.2,
"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":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
]
}
camera_up={
@ -155,6 +162,11 @@ toggle_console={
"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":4194341,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
toggle_mouse={
"deadzone": 0.2,
"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":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
bbcode_edit/toggle_bold={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":66,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
@ -180,12 +192,6 @@ bbcode_edit/editor/open_current_file_documentation={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194332,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
crouch={
"deadzone": 0.2,
"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":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null)
]
}
[internationalization]
@ -197,6 +203,7 @@ locale/translations_pot_files=PackedStringArray("res://src/ui/menus/main_menu/ma
3d_render/layer_1="Static"
3d_render/layer_2="Dynamic"
3d_physics/layer_2="Characters"
3d_physics/layer_3="Interaction"
3d_physics/layer_11="World"
[physics]
@ -208,6 +215,7 @@ jolt_physics_3d/collisions/collision_margin_fraction=0.0
anti_aliasing/quality/screen_space_aa=2
occlusion_culling/use_occlusion_culling=true
environment/defaults/default_environment="uid://cujlm5u722ot7"
[run_configs]

View File

@ -0,0 +1,14 @@
[gd_resource type="Environment" load_steps=4 format=3 uid="uid://cujlm5u722ot7"]
[ext_resource type="Texture2D" uid="uid://bxxamjotmlubu" path="res://resources/editor_panorama.png" id="1_2oonr"]
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_huhbn"]
panorama = ExtResource("1_2oonr")
[sub_resource type="Sky" id="Sky_xdwe2"]
sky_material = SubResource("PanoramaSkyMaterial_huhbn")
[resource]
background_mode = 2
sky = SubResource("Sky_xdwe2")
glow_enabled = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 MiB

View File

@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bdri3fghliji3"
path.s3tc="res://.godot/imported/Glass_orm.png-ab661433c67191ce8cc45b129ded3d93.s3tc.ctex"
uid="uid://bxxamjotmlubu"
path.s3tc="res://.godot/imported/editor_panorama.png-de50614a5c3fcd56125b400a1893f3ae.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
@ -11,8 +11,8 @@ metadata={
[deps]
source_file="res://assets/models/electrics/Glass_orm.png"
dest_files=["res://.godot/imported/Glass_orm.png-ab661433c67191ce8cc45b129ded3d93.s3tc.ctex"]
source_file="res://resources/editor_panorama.png"
dest_files=["res://.godot/imported/editor_panorama.png-de50614a5c3fcd56125b400a1893f3ae.s3tc.ctex"]
[params]

View File

@ -1,12 +1,11 @@
[gd_resource type="Resource" script_class="GameState" load_steps=3 format=3 uid="uid://dpgfu1y1cqhvk"]
[gd_resource type="Resource" script_class="GameState" load_steps=5 format=3 uid="uid://dpgfu1y1cqhvk"]
[ext_resource type="Script" uid="uid://fc1y4sr6ofvq" path="res://src/core/game_state.gd" id="1_0ugyj"]
[ext_resource type="Script" uid="uid://dq4pwtwhxusxc" path="res://src/core/world/world_state.gd" id="2_k3cva"]
[ext_resource type="Resource" uid="uid://d2qpu70epn5rs" path="res://src/worlds/expo_combined_info.tres" id="2_s8hvi"]
[ext_resource type="Script" uid="uid://dlf1vq0qej6bs" path="res://src/core/world/world_info.gd" id="4_k3cva"]
[resource]
script = ExtResource("1_0ugyj")
world_info = ExtResource("2_s8hvi")
level_id = &"OutsideArea"
spawnpoint_id = &"OutsideSpawn"
use_player_transform = false
initial_world = ExtResource("2_s8hvi")
metadata/_custom_type_script = "uid://fc1y4sr6ofvq"

View File

@ -3,13 +3,23 @@ class_name CameraEffect
extends Node
## If the effect isn't enabled, we don't process the effect.
@export var effect_enabled: bool = true: set = set_effect_enabled
## The node we can gain spatial information from.[br]
## Has no effect when unset, unless the specific effect requires it.
@export var root_node: Node3D
## The [CameraEffectTarget] we wan't to change.
@export var target: CameraEffectTarget
## Offset the camera's [member Node3D.position] by this amount.
var position: Vector3
## Offset the camera's [member Node3D.rotation] by this amount.
var rotation: Vector3
var fov: float
## Only change this if you really need to; [b]it overrides the camera fov.[/b][br]
## If set below [code]0.001[/code], this has no effect [i](doesn't override the camera fov)[/i].
var fov: float = -1.0
## Offset the camera's [member Camera3D.fov] by this amount.
var fov_change: float = 0.0
func _process(delta: float) -> void:
@ -21,6 +31,11 @@ func _process(delta: float) -> void:
target.position += position
target.rotation += rotation
if fov >= 0.001:
target.fov = fov
target.fov_change += fov_change
func set_effect_enabled(value: bool) -> void:
effect_enabled = value

View File

@ -4,10 +4,20 @@ extends Node3D
@export var camera: Camera3D
var fov: float = 0.0
var fov_change: float = 0.0
func _ready() -> void:
fov = camera.fov
RenderingServer.frame_post_draw.connect(cleanup_effects, CONNECT_DEFERRED)
func _process(_delta: float) -> void:
camera.fov = clampf(fov + fov_change, 1.0, 179.0)
fov_change = 0.0
func cleanup_effects() -> void:
if not is_instance_valid(get_tree()):
return

View File

@ -0,0 +1,28 @@
class_name ViewRollEffect
extends CameraEffect
@export var character: Character3D
@export var smoothing_speed: float = 10.0
@export_range(-25.0, 25.0, 0.01, "or_greater", "or_less", "suffix:deg")
var roll_max_angle: float = 2.5
var _previous_rotation := Vector3.ZERO
func _process_effect(delta: float) -> void:
if not is_instance_valid(character):
return
var velocity: Vector3 = character.velocity.rotated(Vector3.UP, -root_node.rotation.y)
rotation.z = deg_to_rad(clampf(-velocity.x, -roll_max_angle, roll_max_angle))
rotation.x = deg_to_rad(clampf(velocity.z, -roll_max_angle, roll_max_angle))
var weight: float = 1.0 - pow(0.5, delta * smoothing_speed)
rotation.z = lerp_angle(_previous_rotation.z, rotation.z, weight)
rotation.x = lerp_angle(_previous_rotation.x, rotation.x, weight)
_previous_rotation = rotation
func _effect_disabled() -> void:
_previous_rotation = Vector3.ZERO

View File

@ -0,0 +1 @@
uid://dd0i7xqjwgc6r

View File

@ -1,11 +1,64 @@
class_name GameState
extends Resource
@export var world_info: WorldInfo
@export var level_id: StringName = &""
@export var spawnpoint_id: StringName = &""
@export var initial_world: WorldInfo
@export var current_world_state: WorldState
@export var chapter_index: int = 0
@export var level_data: Dictionary = {}
@export var use_player_transform: bool = true
@export var player_transform: Transform3D
@export var world_states: Dictionary[WorldInfo, WorldState] = {}
@export var unlocked_collectibles: Array[StringName] = []
var current_world_info: WorldInfo
var current_world: World
func create_duplicate() -> GameState:
var game_state := GameState.new()
game_state.initial_world = initial_world
game_state.chapter_index = chapter_index
game_state.unlocked_collectibles = unlocked_collectibles.duplicate()
game_state.world_states = world_states.duplicate_deep(DeepDuplicateMode.DEEP_DUPLICATE_INTERNAL)
return game_state
func initialize_world_state(world_info: WorldInfo, set_as_active: bool = false, reset_if_exists: bool = false) -> WorldState:
if world_states.has(world_info):
if reset_if_exists:
current_world_state = world_states.get(
world_info,
WorldState.create_from_world_info(world_info)
)
return world_states.get(world_info)
var world_state := WorldState.create_from_world_info(world_info)
world_states.set(world_info, world_state)
if set_as_active:
current_world_state = world_state
return world_state
func store_world_state(world_info: WorldInfo, world_state: WorldState) -> void:
world_states.set(world_info, world_state)
func get_level_id(world_info: WorldInfo = null) -> StringName:
var world_state: WorldState = get_world_state(world_info)
if not is_instance_valid(world_state):
return &""
return world_state.level_id if not world_state.level_id.is_empty() else world_state.world_info.initial_level
func get_world_info(world_info: WorldInfo = null) -> WorldInfo:
var world_state: WorldState = get_world_state(world_info)
return world_state.world_info if is_instance_valid(world_state) else initial_world
func get_world_state(world_info: WorldInfo = null) -> WorldState:
return world_states.get(
world_info
if is_instance_valid(world_info)
else current_world_state.world_info
)

View File

@ -39,19 +39,22 @@ func override_game_state() -> void:
if not cooldown_timer.is_stopped():
return
var world: World = GameGlobals.game.world
var world_state: WorldState = world.get_world_state()
if override_chapter_index:
if not chapter_override_if_higher or chapter_index > GameGlobals.game_state.chapter_index:
GameGlobals.game_state.chapter_index = chapter_index
if override_spawnpoint_id:
GameGlobals.game_state.spawnpoint_id = spawnpoint.spawn_id
world_state.spawnpoint_id = spawnpoint.spawn_id
if override_player:
GameGlobals.game.store_player_transform()
GameGlobals.game_state.use_player_transform = use_player_transform
world_state.use_player_transform = use_player_transform
if override_level:
GameGlobals.game_state.level_id = level_loader.level_id
world_state.level_id = level_loader.level_id
if do_save:
GameGlobals.request_save()

View File

@ -0,0 +1,96 @@
class_name InstancePersister
var watched_node: Node: set = set_watched_node
var watched_properties: Array[NodePath] = []
var update_on_child_order_change: bool = false
var _instance_path: String = ""
static func get_owner_nodes(node: Node) -> Array[Node]:
if not is_instance_valid(node):
return [node]
var owners: Array[Node] = []
var owner: Node = node.owner
if is_instance_valid(owner):
owners.append(owner)
owners.append_array(get_owner_nodes(owner))
elif is_instance_valid(node.get_parent()):
if is_instance_valid(node.get_parent().owner):
owners.append_array(get_owner_nodes(node.get_parent()))
else:
owners.append(node.get_parent())
return owners
func _init(bound_node: Node, properties: Array[NodePath] = []) -> void:
SaveManager.pre_save.connect(_on_pre_save)
set_watched_node(bound_node)
for property: NodePath in properties:
persist_property(property, false)
func set_watched_node(node: Node) -> void:
if is_instance_valid(watched_node):
watched_node.child_order_changed.disconnect(_update_instance_path)
if not node.is_inside_tree():
await node.tree_entered
watched_node = node
if update_on_child_order_change and is_instance_valid(watched_node):
watched_node.child_order_changed.connect(_update_instance_path)
_update_instance_path()
func persist_property(property: NodePath, do_save: bool = false) -> void:
if not watched_properties.has(property):
watched_properties.append(property)
if do_save:
GameGlobals.request_save()
func has_entry(property: NodePath) -> bool:
var world_state: WorldState = GameGlobals.game.world.get_world_state()
if not is_instance_valid(world_state):
return false
return world_state.instance_data.has(_get_property_path(property))
func get_entry(property: NodePath, default: Variant = null) -> Variant:
var world_state: WorldState = GameGlobals.game.world.get_world_state()
if not is_instance_valid(world_state):
return default
return world_state.instance_data.get(_get_property_path(property), default)
func _get_property_path(property: NodePath) -> String:
return str(_instance_path, ":", property)
func _update_instance_path() -> void:
var path: String = ""
var owner_nodes: Array[Node] = get_owner_nodes(watched_node)
owner_nodes.reverse()
for owner: Node in owner_nodes:
path += owner.name + "/"
_instance_path = str(path, watched_node.name)
func _on_pre_save(game_state: GameState) -> void:
for property: NodePath in watched_properties:
var value: Variant = watched_node.get_indexed(property)
game_state.current_world.get_world_state().instance_data[_get_property_path(property)] = value

View File

@ -0,0 +1 @@
uid://cumsca0ayykey

View File

@ -0,0 +1,56 @@
class_name InteractionArea
extends Area3D
signal focused
signal unfocused
signal hint_prompts_changed
@export var interaction_types: Array[InteractionType] = []: set = set_interaction_types
var is_focused: bool = false
func _ready() -> void:
set_interaction_types(interaction_types)
func set_interaction_types(types: Array[InteractionType]) -> void:
for type: InteractionType in interaction_types:
if type.hint_prompt_changed.is_connected(hint_prompts_changed.emit):
type.hint_prompt_changed.disconnect(hint_prompts_changed.emit)
interaction_types = types
for type: InteractionType in interaction_types:
if not type.hint_prompt_changed.is_connected(hint_prompts_changed.emit):
type.hint_prompt_changed.connect(hint_prompts_changed.emit)
func set_area_focused(value: bool) -> void:
is_focused = value
(focused if is_focused else unfocused).emit()
for type: InteractionType in interaction_types:
type.set_focused(is_focused)
func get_interaction_strings() -> Array[Array]:
var strings: Array[Array] = []
for interaction_type: InteractionType in interaction_types:
if interaction_type.enabled:
var pre: String = interaction_type.get_hint(0)
var prompt: Texture2D = interaction_type.button_prompt
var post: String = interaction_type.get_hint(1)
strings.append([pre, prompt, post])
print("Interaction Strings: ", strings)
return strings
func _interaction_started(_interaction_ray: InteractionRay) -> void:
pass
func _interaction_ended(_interaction_ray: InteractionRay) -> void:
pass

View File

@ -0,0 +1 @@
uid://c4lc0ubqo7gmp

View File

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://2dre1e56emw6"]
[ext_resource type="Script" uid="uid://c4lc0ubqo7gmp" path="res://src/core/interaction/interaction_area.gd" id="1_mhac1"]
[node name="InteractionArea" type="Area3D"]
collision_layer = 4
collision_mask = 0
script = ExtResource("1_mhac1")
metadata/_custom_type_script = "uid://c4lc0ubqo7gmp"

View File

@ -0,0 +1,41 @@
class_name InteractionRay
extends RayCast3D
signal focused_gained(interaction_area: InteractionArea)
signal focus_lost(interaction_area: InteractionArea)
var is_interacting: bool = false
var focused_area: InteractionArea
func _physics_process(_delta: float) -> void:
var collider: Object = get_collider()
#if is_colliding() and collider is InteractionArea and focused_area != collider:
#focused_area = collider
#focused_gained.emit(focused_area)
#elif not collider is InteractionArea and is_instance_valid(focused_area):
#focused_area = null
#focused_gained.emit(null)
if collider == focused_area:
return
if is_instance_valid(focused_area):
focused_area.set_area_focused(false)
focus_lost.emit(focused_area)
focused_area = collider if collider is InteractionArea else null
focused_gained.emit(focused_area)
if is_instance_valid(focused_area):
focused_area.set_area_focused(true)
func get_interaction() -> InteractionArea:
var collider: Object = get_collider()
if collider is InteractionArea:
return collider
return null

View File

@ -0,0 +1 @@
uid://dw2afgad5q6hs

View File

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://ck2rokdyvqvwg"]
[ext_resource type="Script" uid="uid://dw2afgad5q6hs" path="res://src/core/interaction/interaction_ray.gd" id="1_46xqa"]
[node name="InteractionRay" type="RayCast3D"]
collision_mask = 5
collide_with_areas = true
script = ExtResource("1_46xqa")
metadata/_custom_type_script = "uid://dw2afgad5q6hs"

View File

@ -0,0 +1,74 @@
@abstract
class_name InteractionType
extends Node
signal hint_prompt_changed
@export var enabled: bool = true
@export var hover_hint: String = "Press {prompt} to interact": set = set_hover_hint
@export var button_prompt: Texture2D
#@export var additional_prompts: Dictionary[String, Texture2D] = {}
@export_custom(PROPERTY_HINT_INPUT_NAME, "") var action: StringName = &"interact"
var is_focused: bool = false
var is_interacting: bool = false
func start_interaction() -> void:
if enabled:
is_interacting = true
_interaction_started()
func stop_interaction() -> void:
if enabled:
is_interacting = false
_interaction_ended()
func get_hint(slice_idx: int) -> String:
return hover_hint.get_slice("{prompt}", slice_idx)
#return hover_hint.format({"prompt": str("[img]", button_prompt, "[/img]]")})
# TODO: Convert from string to array.
# "Press {prompt} to {interact} interact{exclamation}"
# ["Press ", Texture, " to ", Texture, " interact", Texture]
func get_full_hint() -> Array:
var prompts: Dictionary[String, Texture2D] = {}#additional_prompts.duplicate()
prompts.set("{prompt}", button_prompt)
var entries: Array = []
var strings: Array[String] = []
for key: String in prompts.keys():
strings.append(hover_hint.split(key))
return entries
func set_focused(value: bool) -> void:
is_focused = value
if enabled:
(_focused if is_focused else _unfocused).call()
func set_hover_hint(text: String) -> void:
hover_hint = text
if is_focused:
hint_prompt_changed.emit()
@abstract func _interaction_started() -> void
@abstract func _interaction_ended() -> void
@abstract func _focused() -> void
@abstract func _unfocused() -> void

View File

@ -0,0 +1 @@
uid://ee0l382hwsad

View File

@ -0,0 +1,62 @@
class_name ButtonInteraction
extends InteractionType
signal turned_on
signal turned_off
@export_range(0.0, 2.0, 0.001, "or_greater", "suffix:s") var interact_cooldown: float = 0.375
@export var can_be_held: bool = false
@export_group("Animation")
@export var animation_player: AnimationPlayer
@export var press_in_animation: StringName = &""
@export var press_out_animation: StringName = &""
var state: bool = false
var _cooldown_timer := Timer.new()
func _ready() -> void:
_cooldown_timer.one_shot = true
_cooldown_timer.timeout.connect(_on_cooldown_timer_timeout)
add_child(_cooldown_timer)
func _unhandled_input(event: InputEvent) -> void:
if not is_focused:
return
if event.is_action_pressed(action):
start_interaction()
elif event.is_action_released(action) and is_interacting:
stop_interaction()
func _interaction_started() -> void:
if not _cooldown_timer.is_stopped():
return
_cooldown_timer.start(interact_cooldown)
enabled = false
state = true
turned_on.emit()
if not can_be_held:
stop_interaction()
func _interaction_ended() -> void:
state = false
turned_off.emit()
func _focused() -> void:
pass
func _unfocused() -> void:
pass
func _on_cooldown_timer_timeout() -> void:
enabled = true

View File

@ -0,0 +1 @@
uid://bvwy23eskb8d

View File

@ -0,0 +1,42 @@
class_name CollectibleInteraction
extends InteractionType
@export var collectible_id: StringName = &""
@export var leave_in_world: bool = true
@export var save_game: bool = true
func _ready() -> void:
if not leave_in_world and GameGlobals.game_state.unlocked_collectibles.has(collectible_id):
get_parent().queue_free()
func _unhandled_input(event: InputEvent) -> void:
if not is_focused:
return
if event.is_action_pressed(action):
start_interaction()
elif event.is_action_released(action):
stop_interaction()
func _interaction_started() -> void:
if not GameGlobals.game_state.unlocked_collectibles.has(collectible_id):
GameGlobals.game_state.unlocked_collectibles.append(collectible_id)
if save_game:
GameGlobals.request_save()
func _interaction_ended() -> void:
if not leave_in_world:
get_parent().queue_free()
func _focused() -> void:
pass
func _unfocused() -> void:
pass

View File

@ -0,0 +1 @@
uid://caxr8dg3iundb

View File

@ -0,0 +1,18 @@
class_name PickupInteraction
extends InteractionType
# TODO: Figure out, how and if we do pickup interactions.
func _interaction_started() -> void:
pass
func _interaction_ended() -> void:
pass
func _focused() -> void:
pass
func _unfocused() -> void:
pass

View File

@ -0,0 +1 @@
uid://ckdo7huqoleoi

View File

@ -0,0 +1,68 @@
class_name SwitchInteraction
extends InteractionType
signal toggled_on
signal toggled_off
@export var start_activated: bool = false
@export var hover_hint_on: String = ""
@export var hover_hint_off: String = ""
@export_range(0.0, 2.0, 0.001, "or_greater", "suffix:s") var interact_cooldown: float = 2.0
var state: bool = false
var _cooldown_timer := Timer.new()
var _instance_persister := InstancePersister.new(self, [^"state"])
func _ready() -> void:
state = _instance_persister.get_entry(^"state", start_activated)
_update_prompt()
_cooldown_timer.one_shot = true
_cooldown_timer.timeout.connect(_on_cooldown_timer_timeout)
add_child(_cooldown_timer)
func _unhandled_input(event: InputEvent) -> void:
if not is_focused:
return
if event.is_action_pressed(action):
start_interaction()
func _interaction_started() -> void:
if not _cooldown_timer.is_stopped():
return
state = not state
hover_hint = ""
if interact_cooldown > 0.0:
_cooldown_timer.start(interact_cooldown)
else:
_update_prompt()
stop_interaction()
(toggled_on if state else toggled_off).emit()
func _interaction_ended() -> void:
pass
func _focused() -> void:
pass
func _unfocused() -> void:
pass
func _update_prompt() -> void:
hover_hint = hover_hint_on if state else hover_hint_off
func _on_cooldown_timer_timeout() -> void:
_update_prompt()

View File

@ -0,0 +1 @@
uid://5y74uiijaxrx

View File

@ -88,6 +88,7 @@ func _init() -> void:
# Setup labels.
_idx_label = Label3D.new()
_idx_label.ignore_occlusion_culling = true
_idx_label.billboard = BaseMaterial3D.BILLBOARD_ENABLED
_idx_label.shaded = false
_idx_label.font_size = 64
@ -149,7 +150,7 @@ func make_current(do_autosave: bool = true) -> void:
GameGlobals.spawn_id = spawn_id
if do_autosave:
SaveManager.save_game()
GameGlobals.request_save()
func generate_unique_identifier() -> StringName:

View File

@ -20,17 +20,19 @@ signal started_vibration
@export var device: int = 0:
get = get_device,
set = set_device
## The delay the vibration by this amount.
## Delay the vibration by this amount.
@export var delay: float = 0.0
@export var editor_delay: float = 0.0
@export var sync_to_audio: bool = false
#region Editor tooling
@warning_ignore_start("unused_private_class_variable")
@export var _editor_weak_vibration: bool = false
@export_tool_button("Test Vibration", "InputEventJoypadMotion")
var _editor_test_vibration: Callable = vibrate
@export_tool_button("Stop Vibration", "MissingNode")
var _editor_stop_test_vibration: Callable = stop_vibration
@warning_ignore_restore("unused_private_class_variable")
#endregion
@export_group("Magnitude")
## [param weak_magnitude] is the strength of the weak motor
@ -48,16 +50,32 @@ var _editor_stop_test_vibration: Callable = stop_vibration
get = get_magnitude_multiplier,
set = set_magnitude_multiplier
@export_group("Weak Controller Overrides", "weak_controller_")
@export var weak_controller_magnitude_multiplier: float = 2.0
@export var weak_controller_duration_multiplier: float = 1.0
var animated_weak_magnitude: float = 0.0:
set(value):
animated_weak_magnitude = clampf(value, 0.0, 1.0)
var animated_strong_magnitude: float = 0.0:
set(value):
animated_strong_magnitude = clampf(value, 0.0, 1.0)
var _ed_was_weak_vibration: bool = false
func _notification(what: int) -> void:
if what == NOTIFICATION_EDITOR_PRE_SAVE:
_ed_was_weak_vibration = _editor_weak_vibration
_editor_weak_vibration = false
elif what == NOTIFICATION_EDITOR_POST_SAVE:
_editor_weak_vibration = _ed_was_weak_vibration
func _process(delta: float) -> void:
if not is_zero_approx(animated_weak_magnitude + animated_strong_magnitude):
if (
can_vibrate()
and not is_zero_approx(animated_weak_magnitude + animated_strong_magnitude)
):
Input.start_joy_vibration.call_deferred(
device, animated_weak_magnitude, animated_strong_magnitude, delta
)
@ -68,35 +86,37 @@ func _process(delta: float) -> void:
## Performs the controller vibration based on given parameters of the component.[br]
## [b]Info[/b]: The [member enabled] parameter must be [code]true[/code].
func vibrate() -> void:
# Don't vibrate if the user has it turned off.
if not Engine.is_editor_hint():
if (
not InputManager.using_controller
#or not ProjectSettings.get_setting("game/input/controller_vibrations", true)
):
return
if not can_vibrate():
return
if enabled:
if sync_to_audio:
var last_mix_time: float = AudioServer.get_time_since_last_mix()
var output_latency: float = AudioServer.get_output_latency()
#SPrint.print_msg("Audio Delay: %s" % (last_mix_time + output_latency))
await get_tree().create_timer(last_mix_time + output_latency).timeout
var is_weak_controller: bool
if delay > 0.0:
await get_tree().create_timer(delay).timeout
if Engine.is_editor_hint():
is_weak_controller = _editor_weak_vibration
else:
is_weak_controller = SettingsManager.get_setting(&"controls", &"using_weak_controller")
if OS.is_debug_build() and editor_delay > 0.0:
await get_tree().create_timer(editor_delay).timeout
if delay > 0.0:
await get_tree().create_timer(delay).timeout
Input.start_joy_vibration(
device,
clampf(weak_magnitude * magnitude_multiplier, 0.0, 1.0),
clampf(strong_magnitude * magnitude_multiplier, 0.0, 1.0),
duration
)
if sync_to_audio:
var last_mix_time: float = AudioServer.get_time_since_last_mix()
var output_latency: float = AudioServer.get_output_latency()
#SPrint.print_msg("Audio Delay: %s" % (last_mix_time + output_latency))
await get_tree().create_timer(last_mix_time + output_latency).timeout
#started_vibration.emit()
var _multiplier: float = magnitude_multiplier * (
weak_controller_magnitude_multiplier if is_weak_controller else 1.0
)
Input.start_joy_vibration(
device,
clampf(weak_magnitude * _multiplier, 0.0, 1.0),
clampf(strong_magnitude * _multiplier, 0.0, 1.0),
duration * (weak_controller_duration_multiplier if is_weak_controller else 1.0)
)
#started_vibration.emit()
## Stops the vibration of the joypad, based on the [member device] parameter,
@ -105,6 +125,18 @@ func stop_vibration() -> void:
Input.stop_joy_vibration(device)
## Don't vibrate if the user has it turned off.
func can_vibrate() -> bool:
if not Engine.is_editor_hint():
if (
not InputManager.using_controller
#or not ProjectSettings.get_setting("game/input/controller_vibrations", true)
):
return false
return enabled
func set_enabled(value: bool) -> void:
enabled = value

View File

@ -11,7 +11,7 @@ extends Area3D
func _ready() -> void:
for spawnpoint: PlayerSpawnPoint in loaded_if_spawnpoint:
if GameGlobals.game_state.spawnpoint_id == spawnpoint.spawn_id:
if GameGlobals.game_state.current_world_state.spawnpoint_id == spawnpoint.spawn_id:
var was_threaded: bool = level_loader.load_threaded
level_loader.load_threaded = false
load_level()

View File

@ -9,7 +9,7 @@ signal level_unloaded
static var level_loaders: Array[LevelLoader]
@export_file("*.tscn", "*.scn") var scene_path: String
@export_tool_button("Edit Level", "Load") var editor_edit: Callable = ed_edit_level
@export_tool_button("Edit Level", "Load") var editor_edit: Callable = _editor_edit_level
@export var load_threaded: bool = true
@export_tool_button("Load Level", "Slot") var editor_load: Callable = load_level
@export_tool_button("Unload Level", "Clear") var editor_unload: Callable = unload_level
@ -62,6 +62,8 @@ func _init() -> void:
if Engine.is_editor_hint():
# Setup labels.
_id_label = Label3D.new()
_id_label.ignore_occlusion_culling = true
_id_label.no_depth_test = true
_id_label.billboard = BaseMaterial3D.BILLBOARD_ENABLED
_id_label.shaded = false
_id_label.font_size = 64
@ -80,7 +82,7 @@ func load_level() -> void:
return
if not Engine.is_editor_hint() and override_level_id:
GameGlobals.game_state.level_id = level_id
GameGlobals.game_state.get_world_state().level_id = level_id
if is_instance_valid(level):
if Utils.get_uid(level.scene_file_path) == Utils.get_uid(scene_path):
@ -101,10 +103,10 @@ func load_level() -> void:
assert(is_instance_valid(scene), "Scene is not valid.")
level = scene.instantiate()
add_child(level)
add_child.call_deferred(level)
is_loading = false
level_loaded.emit()
@ -120,7 +122,7 @@ func unload_level() -> void:
level_unloaded.emit()
func ed_edit_level() -> void:
func _editor_edit_level() -> void:
#EditorInterface.open_scene_from_path(scene_path)
Engine.get_singleton(&"EditorInterface").open_scene_from_path.call_deferred(scene_path)

View File

@ -2,6 +2,7 @@
class_name World
extends Node
@export var world_info: WorldInfo
@export var player_scene: PackedScene = preload(GameGlobals.PLAYER_PATH)
@export var capture_mouse_on_ready: bool = true
@export var initial_spawn_id: StringName = &""#:
@ -33,7 +34,7 @@ func _ready() -> void:
_update_spawnpoint()
LevelLoader.load_initial_levels()
#LevelLoader.load_initial_levels()
player_character = _create_player()
_spawn_player()
@ -42,6 +43,11 @@ func _ready() -> void:
InputManager.set_mouse_captured(true)
func _exit_tree() -> void:
if not Engine.is_editor_hint() and GameGlobals.game_state.current_world == self:
GameGlobals.game_state.current_world = null
func spawn_at_spawnpoint(spawnpoint_id: StringName) -> void:
var spawnpoint := PlayerSpawnPoint.get_spawnpoint_by_identifier(spawnpoint_id)
@ -77,22 +83,35 @@ func get_player_transform() -> Transform3D:
return transform
func restore_player_transform() -> void:
var transform: Transform3D = GameGlobals.game_state.player_transform
func set_player_transform(transform: Transform3D) -> void:
player_character.head.global_basis = transform.basis
player_character.global_position = transform.origin
func create_instance_path_to(node: Node) -> NodePath:
#if node.is_ancestor_of(self):
return NodePath(get_path_to(node, true))
func get_world_state() -> WorldState:
var world_state: WorldState = GameGlobals.game_state.get_world_state(world_info)
if not is_instance_valid(world_state):
return GameGlobals.game_state.initialize_world_state(world_info)
return GameGlobals.game_state.get_world_state(world_info)
func _update_spawnpoint() -> void:
if not is_instance_valid(PlayerSpawnPoint.get_spawnpoint_by_identifier(GameGlobals.game_state.spawnpoint_id)):
GameGlobals.game_state.spawnpoint_id = initial_spawn_id
var world_state: WorldState = get_world_state()
if not is_instance_valid(PlayerSpawnPoint.get_spawnpoint_by_identifier(world_state.spawnpoint_id)):
world_state.spawnpoint_id = initial_spawn_id
if OS.has_feature("editor") and debug_enabled:
if not debug_spawn_point.is_empty():
GameGlobals.game_state.spawnpoint_id = debug_spawn_point
world_state.spawnpoint_id = debug_spawn_point
if debug_chapter_idx >= 0:
GameGlobals.game_state.chapter_index = debug_chapter_idx
world_state.chapter_index = debug_chapter_idx
func _create_player() -> PlayerCharacter:
@ -102,10 +121,12 @@ func _create_player() -> PlayerCharacter:
func _spawn_player() -> void:
var world_state: WorldState = get_world_state()
if (
not (OS.has_feature("editor") and debug_enabled)
and GameGlobals.game_state.use_player_transform
and world_state.use_player_transform
):
restore_player_transform()
set_player_transform(world_state.player_transform)
else:
spawn_at_spawnpoint(GameGlobals.game_state.spawnpoint_id)
spawn_at_spawnpoint(world_state.spawnpoint_id)

View File

@ -11,14 +11,16 @@ func get_initial_level_paths() -> PackedStringArray:
func get_level_paths_from_id(level_id: StringName) -> PackedStringArray:
var matching_level_ids: PackedStringArray = []
var level_paths: PackedStringArray = []
for level: LevelInfo in levels:
if level.level_id == level_id:
matching_level_ids.append(level.level_path)
level_paths.append(level.level_path)
if not matching_level_ids.is_empty():
return matching_level_ids
if level_paths.is_empty():
push_warning(
"No level_id's found for level id '%s' in '%s'."
% [level_id, Utils.uid_to_res_path(resource_path)]
)
push_warning("No level_id found for initial level id '%s' in '%s'." % [level_id, resource_path])
return []
return level_paths

View File

@ -0,0 +1,17 @@
class_name WorldState
extends Resource
@export var world_info: WorldInfo
@export var level_id: StringName = &""
@export var spawnpoint_id: StringName = &""
@export var use_player_transform: bool = false
@export var player_transform: Transform3D
@export var instance_data: Dictionary = {}
static func create_from_world_info(info: WorldInfo) -> WorldState:
var world_state := WorldState.new()
world_state.world_info = info
world_state.level_id = info.initial_level
return world_state

View File

@ -0,0 +1 @@
uid://dq4pwtwhxusxc

View File

@ -14,7 +14,7 @@ func _ready() -> void:
AudioManager.play_audio(preload("uid://vft8mjglpa2u"), AudioManager.AMBIENCE)
if load_to_world_info:
load_to_world(GameGlobals.game_state.world_info)
load_to_world(GameGlobals.game_state.current_world_info)
elif SceneFader.is_fading:
SceneFader.fade_out()
@ -35,11 +35,10 @@ func load_to_world(world_info: WorldInfo) -> void:
var new_world: Node = loaded_world.instantiate()
assert(new_world is World, "Loaded scene is not of type [World].")
add_child(new_world)
SceneFader.fade_out()
set_world(new_world)
SceneFader.fade_out.call_deferred()
func get_world() -> World:
return world
@ -47,6 +46,7 @@ func get_world() -> World:
func set_world(new_world: World) -> void:
world = new_world
GameGlobals.game_state.current_world = world
func reload_world() -> void:
@ -58,5 +58,8 @@ func reload_world() -> void:
add_child(world)
func store_player_transform() -> void:
GameGlobals.game_state.player_transform = get_world().get_player_transform()
func store_player_transform(force: bool = false) -> void:
if is_instance_valid(world):
world.get_world_state().player_transform = world.get_player_transform()
elif force:
GameGlobals.game_state.get_world_state().player_transform = world.get_player_transform()

View File

@ -34,19 +34,10 @@ const CONTROLLER_INVERT_Y_PATH: StringName = &"game/input/camera_controller_inve
@export var controller_invert_x: bool = false
@export var controller_invert_y: bool = false
@export_group("Headbobbing", "headbob_")
@export var headbob_range: float = 0.25
@export var headbob_frequency: float = 0.5
@export var headbob_multiplier: float = 1.0
@export var headbob_target: Node3D
var rotational_direction: Vector2
var rotational_velocity: Vector2
var input_event: InputEvent
var using_controller: bool = false
# Headbobbing
var headbob_time: float = 0.0
var headbob_enabled: bool = true
func _ready() -> void:
@ -58,29 +49,15 @@ func _ready() -> void:
invert_y = ProjectSettings.get_setting(INVERT_Y_PATH, false)
controller_invert_x = ProjectSettings.get_setting(CONTROLLER_INVERT_X_PATH, false)
controller_invert_y = ProjectSettings.get_setting(CONTROLLER_INVERT_Y_PATH, false)
headbob_enabled = SettingsManager.get_setting(&"misc", &"headbobbing")
SettingsManager.settings_changed.connect(_update_settings)
ProjectSettings.settings_changed.connect(_update_settings)
_update_settings.call()
#_setup_step_smoothing()
func _process(delta: float) -> void:
if not is_instance_valid(GameGlobals.game) or not GameGlobals.game.world.in_cutscene:
_process_input(delta)
#_perform_head_bob(delta)
#
#if is_instance_valid(character):
#if character.is_on_floor() and not character.was_on_floor:
#if absf(character.previous_velocity.y) > impact_min_fall_velocity:
#var fall_velocity: float = maxf(-character.previous_velocity.y * 0.5, impact_max_fall_velocity)
#add_impact(Vector3.DOWN * 0.15 * fall_velocity, 0.35)
#
#_process_impact(delta)
#
#_process_step_smoothing(delta)
func _unhandled_input(event: InputEvent) -> void:
@ -172,25 +149,3 @@ func _process_controller(delta: float) -> void:
func _lerp_rotational_velocity(sensitivity: float, friction: float, delta: float) -> Vector2:
return rotational_velocity.lerp(rotational_direction * sensitivity, friction * delta)
#endregion
#region Headbobbing
func _perform_head_bob(delta: float) -> void:
if not headbob_enabled:
headbob_target.position = Vector3.ZERO
headbob_target.rotation.z = 0.0
headbob_time = 0.0
return
var headbob_speed: float = maxf((character.velocity * Utils.VEC3_HOR).length(), 1.0)
SPrint.print_msgf(str("Headbob-Speed: ", headbob_speed), true)
SPrint.print_msgf(str("Headbob-Clock: ", headbob_time), true)
headbob_time += delta * headbob_speed * headbob_multiplier
headbob_time = fposmod(headbob_time, TAU)
headbob_target.position.y = sin(headbob_time * headbob_frequency) * headbob_range
headbob_target.position.x = cos(headbob_time * headbob_frequency / 2) * headbob_range
headbob_target.rotation.z = deg_to_rad(lerp(headbob_target.position.x, headbob_target.position.y, 0.5)) * TAU
SPrint.print_msgf(str("Head Z-Rotation: ", headbob_target.rotation.z), true)
#endregion

View File

@ -0,0 +1,64 @@
class_name Hud
extends CanvasLayer
@export var interaction_ray: InteractionRay: set = set_interaction_ray
@onready var interaction_prompt: RichTextLabel = $InteractionPrompt
@onready var crosshair: AnimatedSprite2D = %Crosshair
func _ready() -> void:
crosshair.play(&"to_dot", 1.0, true)
func set_interaction_ray(ray: InteractionRay) -> void:
if is_instance_valid(interaction_ray):
interaction_ray.focused_gained.disconnect(_on_interaction_ray_focused)
interaction_ray.focus_lost.disconnect(_on_interaction_ray_focus_lost)
interaction_ray = ray
if is_instance_valid(interaction_ray):
interaction_ray.focused_gained.connect(_on_interaction_ray_focused)
interaction_ray.focus_lost.connect(_on_interaction_ray_focus_lost)
func _on_interaction_ray_focused(area: InteractionArea) -> void:
if is_instance_valid(area):
area.hint_prompts_changed.connect(_populate_focused_hints.bind(area))
_populate_focused_hints(area)
_play_crosshair_anim(&"to_hollow")
else:
interaction_prompt.clear()
_play_crosshair_anim(&"to_dot")
func _on_interaction_ray_focus_lost(area: InteractionArea) -> void:
area.hint_prompts_changed.disconnect(_populate_focused_hints)
func _play_crosshair_anim(anim_name: StringName) -> void:
if crosshair.animation != anim_name:
crosshair.play(anim_name)
func _populate_focused_hints(area: InteractionArea) -> void:
interaction_prompt.clear()
interaction_prompt.push_paragraph(HORIZONTAL_ALIGNMENT_CENTER)
#for hint: Array in area.get_interaction_strings():
#for entry: Variant in hint:
#if typeof(entry) == TYPE_STRING:
#interaction_prompt.append_text(entry)
#elif entry is Texture2D:
#interaction_prompt.add_image(entry, 42, 42)
#
#interaction_prompt.add_text("\n")
for string: Array in area.get_interaction_strings():
if not string[0].is_empty() or not string[2].is_empty():
interaction_prompt.append_text(string[0])
interaction_prompt.add_image(string[1], 42, 42)
interaction_prompt.append_text(string[2] + "\n")
interaction_prompt.pop_all()

View File

@ -0,0 +1 @@
uid://gvuvxikepb2r

Some files were not shown because too many files have changed in this diff Show More