mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 23:10:08 +01:00
Use static typing in all demos (#1063)
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).
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
extends Label
|
||||
|
||||
func _ready() -> void:
|
||||
var engine_name := ""
|
||||
|
||||
func _process(_delta):
|
||||
var engine_name = ""
|
||||
match System.get_physics_engine():
|
||||
System.PhysicsEngine.GODOT_PHYSICS:
|
||||
engine_name = "GodotPhysics 2D"
|
||||
System.PhysicsEngine.OTHER:
|
||||
var engine_setting = ProjectSettings.get_setting("physics/2d/physics_engine")
|
||||
var engine_setting := String(ProjectSettings.get_setting("physics/2d/physics_engine"))
|
||||
engine_name = "Other (%s)" % engine_setting
|
||||
set_text("Physics engine: %s" % engine_name)
|
||||
|
||||
text = "Physics engine: %s" % engine_name
|
||||
|
||||
Reference in New Issue
Block a user