mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 16:00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user