Skip to content

Commit be77353

Browse files
authored
Move position setting code to be before direction in Dodge the Creeps (#1151)
1 parent d3c71dd commit be77353

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

2d/dodge_the_creeps/main.gd

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ func _on_MobTimer_timeout():
2929
var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
3030
mob_spawn_location.progress = randi()
3131

32-
# Set the mob's direction perpendicular to the path direction.
33-
var direction = mob_spawn_location.rotation + PI / 2
34-
3532
# Set the mob's position to a random location.
3633
mob.position = mob_spawn_location.position
3734

35+
# Set the mob's direction perpendicular to the path direction.
36+
var direction = mob_spawn_location.rotation + PI / 2
37+
3838
# Add some randomness to the direction.
3939
direction += randf_range(-PI / 4, PI / 4)
4040
mob.rotation = direction

0 commit comments

Comments
 (0)