Initial project sync
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
extends Node
|
||||
|
||||
@export var sample_limit := 20
|
||||
|
||||
var _samples := 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_process_input(true)
|
||||
var rhythm := _rhythm_manager()
|
||||
if rhythm != null and rhythm.has_method("start"):
|
||||
rhythm.call("start")
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
var key := event as InputEventKey
|
||||
if key == null or not key.pressed or key.echo:
|
||||
return
|
||||
_print_clock_sample(Time.get_ticks_msec())
|
||||
|
||||
|
||||
func _print_clock_sample(timestamp_ms: float) -> void:
|
||||
var rhythm := _rhythm_manager()
|
||||
if rhythm == null:
|
||||
push_warning("ClockDebug requires the RhythmManager autoload.")
|
||||
return
|
||||
|
||||
var song_time := float(rhythm.call("input_to_song_time", timestamp_ms))
|
||||
var rating: Dictionary = rhythm.call("get_rating_for_time", song_time)
|
||||
var nearest_beat := int(rating.get("nearest_beat", -1))
|
||||
var diff_ms := float(rating.get("diff", 0.0)) * 1000.0
|
||||
_samples += 1
|
||||
print("clock_debug sample=%d song_time=%.3f beat=%d diff_ms=%.2f" % [_samples, song_time, nearest_beat, diff_ms])
|
||||
|
||||
if sample_limit > 0 and _samples >= sample_limit:
|
||||
print("clock_debug sample limit reached")
|
||||
|
||||
|
||||
func _rhythm_manager() -> Node:
|
||||
return get_node_or_null("/root/RhythmManager")
|
||||
@@ -0,0 +1 @@
|
||||
uid://s13x8nbmfsc8
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/main/clock_debug.gd" id="1_clock"]
|
||||
|
||||
[node name="ClockDebug" type="Node"]
|
||||
script = ExtResource("1_clock")
|
||||
@@ -0,0 +1,19 @@
|
||||
extends Node2D
|
||||
|
||||
@onready var stage: Node = $Stage
|
||||
@onready var ui: Node = $UILayer/UI
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if ui != null and ui.has_method("bind_debug_actor"):
|
||||
ui.call("bind_debug_actor", get_player())
|
||||
if ui != null and ui.has_method("bind_boss_actor"):
|
||||
ui.call("bind_boss_actor", get_boss())
|
||||
|
||||
|
||||
func get_player() -> Node:
|
||||
return stage.get_node("ActorsContainer/Player")
|
||||
|
||||
|
||||
func get_boss() -> Node:
|
||||
return stage.get_node("ActorsContainer/Boss")
|
||||
@@ -0,0 +1 @@
|
||||
uid://q1v3lbqlej3y
|
||||
@@ -0,0 +1,28 @@
|
||||
[gd_scene format=3 uid="uid://dimsne1iyxg20"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://q1v3lbqlej3y" path="res://scenes/main/main.gd" id="1_main"]
|
||||
[ext_resource type="PackedScene" uid="uid://dimgym86pdqmd" path="res://scenes/stage/stage.tscn" id="2_stage"]
|
||||
[ext_resource type="Script" uid="uid://vea0brdgpneb" path="res://scenes/chart/chart_runner.gd" id="3_chart_runner"]
|
||||
[ext_resource type="Resource" uid="uid://3xrcwnvo4ih3" path="res://resources/charts/stage9_boss_duel.tres" id="4_stage7_chart"]
|
||||
[ext_resource type="PackedScene" uid="uid://d4fldy342eji2" path="res://scenes/ui/main_ui.tscn" id="5_ui"]
|
||||
[ext_resource type="Script" uid="uid://c3agddgh7fn4a" path="res://scenes/audio/audio_layer_controller.gd" id="6_audio_layers"]
|
||||
|
||||
[node name="Main" type="Node2D" unique_id=28024565]
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="Stage" parent="." unique_id=442949244 instance=ExtResource("2_stage")]
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="." unique_id=166482417]
|
||||
layer = 10
|
||||
|
||||
[node name="UI" parent="UILayer" unique_id=299590534 instance=ExtResource("5_ui")]
|
||||
|
||||
[node name="ChartRunner" type="Node" parent="." unique_id=110188885]
|
||||
script = ExtResource("3_chart_runner")
|
||||
chart = ExtResource("4_stage7_chart")
|
||||
actors_container_path = NodePath("../Stage/ActorsContainer")
|
||||
|
||||
[node name="AudioLayerController" type="Node" parent="." unique_id=1902714634]
|
||||
script = ExtResource("6_audio_layers")
|
||||
|
||||
[editable path="Stage"]
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://scenes/ground/ground.tscn" id="1_ground"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/characters/player.tscn" id="2_player"]
|
||||
|
||||
[node name="Stage4Playtest" type="Node2D"]
|
||||
|
||||
[node name="Ground" parent="." instance=ExtResource("1_ground")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_player")]
|
||||
position = Vector2(2047, 366)
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(2047, 230)
|
||||
zoom = Vector2(2.5, 2.5)
|
||||
enabled = true
|
||||
Reference in New Issue
Block a user