mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 16:00:08 +01: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).
13 lines
460 B
GDScript
13 lines
460 B
GDScript
# This acts as a staging scene shown until the main scene is fully loaded.
|
|
extends Control
|
|
|
|
func _ready() -> void:
|
|
for i in 2:
|
|
# Wait 2 frames before starting to change to the main scene,
|
|
# so that the loading text can be shown instead of the splash screen.
|
|
await get_tree().process_frame
|
|
|
|
# Do not use `preload()` to avoid incurring the loading time before the
|
|
# loading text can be shown.
|
|
get_tree().change_scene_to_packed(load("res://test.tscn"))
|