Compare commits

..

2 Commits

11 changed files with 1971 additions and 0 deletions

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://ddfnb7m4ufpmu"
path="res://.godot/imported/Liquid Gold.mp3-22723f81c2494a2c1e2a1680e9834f48.mp3str"
[deps]
source_file="res://_development/ayuroo/levels/_chase_test/Liquid Gold.mp3"
dest_files=["res://.godot/imported/Liquid Gold.mp3-22723f81c2494a2c1e2a1680e9834f48.mp3str"]
[params]
loop=false
loop_offset=0.0
bpm=80.0
beat_count=0
bar_beats=4

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
extends Level
signal beat_tick(beat: int)
const SPEED_TRANSITION_DISTANCE: float = 0.1
const BPM: int = 160
var _previous_beat: int = 0
@onready var progress_track: Path3D = $ProgressTrack
@onready var player_desired_progress: PathFollow3D = $ProgressTrack/PlayerDesiredProgress
@onready var music_animation: AnimationPlayer = $MusicAnimation
@onready var debug_visualizer: MeshInstance3D = $ProgressTrack/PlayerDesiredProgress/DebugVisualizer
@onready var music: AudioStreamPlayer = $Music
func _ready() -> void:
InputManager.set_mouse_captured(true)
beat_tick.connect(_on_beat_tick)
GameGlobals.player.global_position = PlayerSpawnPoint.get_spawn_point_by_identifier(&"ChaseBeginning").global_position
func _process(_delta: float) -> void:
if not music_animation.is_playing():
return
# Beat tick
var _current_time: float = music_animation.current_animation_position + AudioServer.get_time_since_last_mix()
SPrint.print_msgf("Current Music-Time: %s" % _current_time)
_current_time -= AudioServer.get_output_latency()
var beat := int(_current_time * BPM / 60.0)
if _previous_beat != beat:
_previous_beat = beat
beat_tick.emit(beat)
func _physics_process(delta: float) -> void:
var player_character: PlayerCharacter = GameGlobals.player
var player_offset: float = progress_track.curve.get_closest_offset(player_character.global_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,
clampf(desired_speed_scale, 0.1, 1.05),
delta
)
func _on_start_chase_area_body_entered(_body: Node3D) -> void:
music_animation.play(&"main_track")
func _on_beat_tick(beat: int) -> void:
debug_visualizer.scale = Vector3.ONE * (1.25 if beat % 2 == 0 else 1.0)

View File

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

View File

@ -0,0 +1,129 @@
[gd_scene load_steps=17 format=3 uid="uid://d013wo01v8lr5"]
[ext_resource type="Script" uid="uid://cdgei0ihcem0n" path="res://_development/ayuroo/levels/_chase_test/_chase_test.gd" id="1_tqtrq"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="2_14tye"]
[ext_resource type="AnimationLibrary" uid="uid://ck15gq8qw1rfg" path="res://_development/ayuroo/levels/_chase_test/_chase_anim.tres" id="2_gsfaw"]
[ext_resource type="Script" uid="uid://3hlvt5k34xva" path="res://src/core/player_spawn_point.gd" id="3_hw8mu"]
[ext_resource type="Script" uid="uid://dp6jy00a6xuhk" path="res://tools/beat_measurer.gd" id="4_hw8mu"]
[ext_resource type="PackedScene" uid="uid://c0jearfhlqcvr" path="res://src/gameplay/hazards/saw/saw.tscn" id="5_yax8p"]
[ext_resource type="PackedScene" uid="uid://kne8gkorpuop" path="res://src/ui/menus/death_screen/death_screen.tscn" id="6_u6lfm"]
[ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/vibration_component.gd" id="7_mop3m"]
[ext_resource type="PackedScene" uid="uid://dawmen0hlfaaq" path="res://src/ui/menus/pause_menu/pause_menu.tscn" id="8_ff8bp"]
[ext_resource type="PackedScene" uid="uid://srvm3v1grugk" path="res://_development/ayuroo/levels/_experimental/_layout_test.tscn" id="9_gsfaw"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_tqtrq"]
sky_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)
ground_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)
[sub_resource type="Sky" id="Sky_yax8p"]
sky_material = SubResource("ProceduralSkyMaterial_tqtrq")
[sub_resource type="Environment" id="Environment_u6lfm"]
background_mode = 2
sky = SubResource("Sky_yax8p")
tonemap_mode = 2
glow_enabled = true
[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, -1150),
"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_tqtrq")
metadata/_custom_type_script = "uid://cigop0ivp5vvu"
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0)
shadow_enabled = true
directional_shadow_max_distance = 1.0
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_u6lfm")
[node name="Music" type="AudioStreamPlayer" parent="."]
volume_db = -6.0
[node name="MusicAnimation" type="AnimationPlayer" parent="."]
callback_mode_process = 0
libraries = {
&"": ExtResource("2_gsfaw")
}
[node name="PlayerSpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
script = ExtResource("3_hw8mu")
spawn_id = &"ChaseBeginning"
metadata/_custom_type_script = "uid://3hlvt5k34xva"
[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="BeatMeasurer" type="Node" parent="ProgressTrack" node_paths=PackedStringArray("path")]
script = ExtResource("4_hw8mu")
path = NodePath("..")
track_duration = 208.54
track_bpm = 160
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, -580)
size = Vector3(14, 1, 1161)
material = ExtResource("2_14tye")
[node name="Saws" type="Node3D" parent="."]
[node name="ResetSaw" parent="Saws" instance=ExtResource("5_yax8p")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 1, -1006.4116)
[node name="Saw" parent="Saws" instance=ExtResource("5_yax8p")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -46)
[node name="Saw2" parent="Saws" instance=ExtResource("5_yax8p")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -53)
[node name="VibrationComponent" type="Node" parent="."]
script = ExtResource("7_mop3m")
duration = 0.1
delay = 0.188
strong_magnitude = 0.0
metadata/_custom_type_script = "uid://bbwtct3hoxwws"
[node name="Menus" type="CanvasLayer" parent="."]
[node name="DeathScreen" parent="Menus" instance=ExtResource("6_u6lfm")]
[node name="PauseMenu" parent="Menus" instance=ExtResource("8_ff8bp")]
[node name="LayoutTest" parent="." instance=ExtResource("9_gsfaw")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, 28)
[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

@ -0,0 +1,294 @@
[gd_scene load_steps=6 format=3 uid="uid://srvm3v1grugk"]
[ext_resource type="Script" uid="uid://cigop0ivp5vvu" path="res://src/core/level/level.gd" id="1_0kdur"]
[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/materials/dev/dark/dark_01.tres" id="2_cxrf3"]
[ext_resource type="Script" uid="uid://briioihkxilxm" path="res://addons/proto_shape/proto_ramp/proto_ramp.gd" id="3_cv3fe"]
[ext_resource type="Material" uid="uid://bwbwqb84pmji3" path="res://assets/materials/dev/orange/orange_04.tres" id="4_kb2k5"]
[ext_resource type="PackedScene" uid="uid://clhy3kiceqf2o" path="res://src/gameplay/characters/player/player_character.tscn" id="5_p8lkr"]
[node name="LayoutTest" type="Node3D"]
script = ExtResource("1_0kdur")
metadata/_custom_type_script = "uid://cigop0ivp5vvu"
[node name="Blockout" type="CSGCombiner3D" parent="."]
use_collision = true
[node name="CSGBox3D" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -3.5)
size = Vector3(2, 1, 8)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D2" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 3.5, -3.2)
size = Vector3(2, 7, 7.4)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D5" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 5.5, -15)
size = Vector3(1, 3, 17)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D9" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 5.5, -15)
size = Vector3(9, 3, 1)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D3" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 3.5, -3.2)
size = Vector3(1, 7, 7.4)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D6" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7, 5, -8.5)
size = Vector3(10, 4, 4)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D11" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 11.5, 5, -15.5)
size = Vector3(1, 4, 10)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D12" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.5, 5, -20)
size = Vector3(9, 4, 1)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D18" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, -23)
size = Vector3(22, 8, 1)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D15" type="CSGBox3D" parent="Blockout/CSGBox3D18"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2, -0.375)
operation = 2
size = Vector3(1, 2, 0.25)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D16" type="CSGBox3D" parent="Blockout/CSGBox3D18"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.5, 0.25)
operation = 2
size = Vector3(4, 3, 1)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D17" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 5, -21.5)
size = Vector3(1, 4, 2)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D4" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -10.7)
size = Vector3(4, 4, 7.6)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D11" type="CSGBox3D" parent="Blockout/CSGBox3D4"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3.5)
operation = 2
size = Vector3(2, 4, 0.6)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D8" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.5, 3.5, -15)
size = Vector3(9, 1, 9)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D13" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.5, -19.5)
size = Vector3(4, 1, 8)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D15" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.5, -25.5)
size = Vector3(10, 1, 4)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D7" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 7.5, -11)
size = Vector3(5, 1, 23)
material = ExtResource("2_cxrf3")
[node name="CSGBox3D10" type="CSGBox3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7, 7.5, -13.5)
size = Vector3(10, 1, 14)
material = ExtResource("2_cxrf3")
[node name="ProtoRamp" type="Node3D" parent="Blockout"]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 1, -2)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 0.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="StairSteppingTest" type="Node3D" parent="Blockout"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -25, 0)
visible = false
[node name="ProtoRamp2" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(0.7071068, 0, -0.7071067, 0, 1, 0, 0.7071067, 0, 0.7071068, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp3" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(0.2588189, 0, 0.9659258, 0, 1, 0, -0.9659258, 0, 0.2588189, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp4" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(0.86602527, 0, 0.50000006, 0, 1, 0, -0.50000006, 0, 0.86602527, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp5" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(0.25881913, 0, -0.9659257, 0, 1, 0, 0.9659257, 0, 0.25881913, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp6" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(0.9659258, 0, -0.25881886, 0, 1, 0, 0.25881886, 0, 0.9659258, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp7" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(0.49999985, 0, 0.8660254, 0, 1, 0, -0.8660254, 0, 0.49999985, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp8" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(-0.2588191, 0, 0.9659256, 0, 1, 0, -0.9659256, 0, -0.2588191, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp9" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(-0.2588191, 0, 0.9659256, 0, 1, 0, -0.9659256, 0, -0.2588191, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="ProtoRamp10" type="Node3D" parent="Blockout/StairSteppingTest"]
transform = Transform3D(-0.25881892, 0, -0.96592563, 0, 1, 0, 0.96592563, 0, -0.25881892, 0, 1, 1)
script = ExtResource("3_cv3fe")
type = 1
collisions_enabled = true
width = 2.0
height = 3.0
depth = 5.5
anchor = 0
anchor_fixed = true
fill = 1.0
material = ExtResource("4_kb2k5")
calculation = 0
steps = 16
metadata/_custom_type_script = "uid://briioihkxilxm"
[node name="Lighting" type="Node3D" parent="."]
[node name="SpotLight3D" type="SpotLight3D" parent="Lighting"]
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 6, -4)
spot_range = 8.0
[node name="OmniLight3D" type="OmniLight3D" parent="Lighting"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 5, -12.5)
[node name="OmniLight3D2" type="OmniLight3D" parent="Lighting"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 5, -17.5)
[node name="OmniLight3D3" type="OmniLight3D" parent="Lighting"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, -21.5)
[node name="PlayerCharacter" parent="." instance=ExtResource("5_p8lkr")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9999999, 0)

View File

@ -63,3 +63,11 @@ func _on_settings_button_pressed() -> void:
main_menu_ui.hide()
options_menu.show()
func _on_chase_button_pressed() -> void:
if SceneFader.is_fading:
return
AudioManager.fade_audio(AMBIENCE_STREAM, -80.0, SceneFader.fade_out_duration, AudioManager.AMBIENCE, true)
SceneFader.load_to_path("uid://d013wo01v8lr5")

View File

@ -54,6 +54,11 @@ unique_name_in_owner = true
layout_mode = 2
text = "NEW_GAME"
[node name="ChaseButton" type="Button" parent="MainMenuUI/ButtonContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Chase Test"
[node name="SettingsButton" type="Button" parent="MainMenuUI/ButtonContainer"]
unique_name_in_owner = true
layout_mode = 2
@ -95,5 +100,6 @@ fov = 55.0
[connection signal="pressed" from="MainMenuUI/ButtonContainer/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="MainMenuUI/ButtonContainer/NewGameButton" to="." method="_on_new_game_button_pressed"]
[connection signal="pressed" from="MainMenuUI/ButtonContainer/ChaseButton" to="." method="_on_chase_button_pressed"]
[connection signal="pressed" from="MainMenuUI/ButtonContainer/SettingsButton" to="." method="_on_settings_button_pressed"]
[connection signal="pressed" from="MainMenuUI/ButtonContainer/QuitButton" to="." method="_on_quit_button_pressed"]

View File

@ -0,0 +1,36 @@
@tool
class_name BeatMeasurer
extends Node
@export var path: Path3D
@export var track_duration: float = 1.0
@export var track_bpm: int = 120
@export var track_bars: int = 4
@export_tool_button("Force Update") var editor_force_update: Callable = _update_measurement
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
path.curve_changed.connect(_update_measurement)
_update_measurement.call_deferred()
func _update_measurement() -> void:
for child: Node in get_children():
if child.owner == null:
child.queue_free()
var path_length: float = path.curve.get_baked_length()
var beat_time: float = track_bpm / 60.0
var beats := int(path_length / beat_time)
for beat: int in range(beats):
var progress: float = beat_time * beat
var position: Vector3 = path.global_position + path.curve.sample_baked(progress)
DebugDraw3D.draw_sphere(position, 0.15, Color.WHITE, 5.0 if Engine.is_editor_hint() else 500.0)
var label := Label3D.new()
label.text = str(beat)
label.billboard = BaseMaterial3D.BILLBOARD_ENABLED
add_child(label)
label.global_position = position + Vector3.UP

View File

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