Initial commit: Fighting_Rthythm_game project setup
This commit is contained in:
41
tests/test_rhythm_ui.gd
Normal file
41
tests/test_rhythm_ui.gd
Normal file
@@ -0,0 +1,41 @@
|
||||
extends SceneTree
|
||||
|
||||
var failures: Array[String] = []
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
var scene: PackedScene = load("res://scenes/main/main.tscn")
|
||||
if scene == null:
|
||||
push_error("Could not load main.tscn")
|
||||
quit(1)
|
||||
return
|
||||
|
||||
var main: Node = scene.instantiate()
|
||||
var required_nodes := [
|
||||
"RhythmFeedback/RhythmTrack",
|
||||
"RhythmFeedback/RhythmTrack/LeftRod",
|
||||
"RhythmFeedback/RhythmTrack/RightRod",
|
||||
"RhythmFeedback/RhythmTrack/CenterBase",
|
||||
"RhythmFeedback/RhythmTrack/CenterFlash",
|
||||
"RhythmFeedback/RhythmTrack/LeftMover",
|
||||
"RhythmFeedback/RhythmTrack/RightMover",
|
||||
"RhythmFeedback/RhythmTrack/BlueBallLeft1",
|
||||
"RhythmFeedback/RhythmTrack/BlueBallRight1",
|
||||
"RhythmFeedback/JudgementLabel",
|
||||
]
|
||||
for node_path: String in required_nodes:
|
||||
if not main.has_node(node_path):
|
||||
failures.append("Missing rhythm UI node: %s" % node_path)
|
||||
|
||||
if main.has_method("_update_rhythm_track") == false:
|
||||
failures.append("Main script missing _update_rhythm_track")
|
||||
|
||||
main.free()
|
||||
|
||||
if failures.is_empty():
|
||||
print("PASS rhythm ui")
|
||||
quit(0)
|
||||
else:
|
||||
for failure: String in failures:
|
||||
push_error(failure)
|
||||
quit(1)
|
||||
Reference in New Issue
Block a user