From be773539172bdf6976d2ebf6f61c32524d6bd499 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Fri, 10 Jan 2025 12:52:54 -0600 Subject: [PATCH] Move position setting code to be before direction in Dodge the Creeps (#1151) --- 2d/dodge_the_creeps/main.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/2d/dodge_the_creeps/main.gd b/2d/dodge_the_creeps/main.gd index b59b1b28..3e8cf2f8 100644 --- a/2d/dodge_the_creeps/main.gd +++ b/2d/dodge_the_creeps/main.gd @@ -29,12 +29,12 @@ func _on_MobTimer_timeout(): var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation") mob_spawn_location.progress = randi() - # Set the mob's direction perpendicular to the path direction. - var direction = mob_spawn_location.rotation + PI / 2 - # Set the mob's position to a random location. mob.position = mob_spawn_location.position + # Set the mob's direction perpendicular to the path direction. + var direction = mob_spawn_location.rotation + PI / 2 + # Add some randomness to the direction. direction += randf_range(-PI / 4, PI / 4) mob.rotation = direction