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:
Hugo Locurcio
2024-06-01 12:12:18 +02:00
committed by GitHub
parent 8e9c180278
commit bac1e69164
498 changed files with 5218 additions and 4776 deletions

View File

@@ -50,7 +50,7 @@ func _integrate_forces(state: PhysicsDirectBodyState2D) -> void:
if spawn:
_spawn_enemy_above.call_deferred()
# Deapply prev floor velocity.
# Deapply previous floor velocity.
velocity.x -= floor_h_velocity
floor_h_velocity = 0.0
@@ -59,7 +59,7 @@ func _integrate_forces(state: PhysicsDirectBodyState2D) -> void:
var floor_index := -1
for contact_index in state.get_contact_count():
var collision_normal = state.get_contact_local_normal(contact_index)
var collision_normal := state.get_contact_local_normal(contact_index)
if collision_normal.dot(Vector2(0, -1)) > 0.6:
found_floor = true