mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
This leads to code that is easier to understand and runs faster thanks to GDScript's typed instructions. The untyped declaration warning is now enabled on all projects where type hints were added. All projects currently run without any untyped declration warnings. Dodge the Creeps and Squash the Creeps demos intentionally don't use type hints to match the documentation, where type hints haven't been adopted yet (given its beginner focus).
17 lines
369 B
GDScript
17 lines
369 B
GDScript
extends Panel
|
|
|
|
@onready var fsm_node: Node = get_node(^"../../Player/StateMachine")
|
|
|
|
func _process(_delta: float) -> void:
|
|
var states_names := ""
|
|
var numbers := ""
|
|
var index := 0
|
|
|
|
for state: Node in fsm_node.states_stack:
|
|
states_names += String(state.name) + "\n"
|
|
numbers += str(index) + "\n"
|
|
index += 1
|
|
|
|
%States.text = states_names
|
|
%Numbers.text = numbers
|