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).
9 lines
359 B
GDScript
9 lines
359 B
GDScript
extends Panel
|
|
|
|
func _on_goto_scene_pressed() -> void:
|
|
# Change the scene to the given PackedScene.
|
|
# Though it usually takes more code, this can have advantages, such as letting you load the
|
|
# scene in another thread, or use a scene that isn't saved to a file.
|
|
var scene: PackedScene = load("res://scene_a.tscn")
|
|
get_tree().change_scene_to_packed(scene)
|