@@ -49,7 +49,7 @@ signal direction_changed(new_direction: Directions.Points)
4949 animation_scene = null
5050 return
5151
52- _follower .add_child (animation )
52+ follower .add_child (animation )
5353
5454## The gamepiece will traverse a movement path at [code]move_speed[/code] pixels per second.
5555## [/br][/br]Note that extremely high speeds (finish a long path in a single frame) will produce
@@ -98,7 +98,7 @@ var destination: Vector2
9898# the gamepiece in _ready(), however) in order to simplify path management. All path coordinates may
9999# be provided in game-world coordinates and will remain relative to the origin even as the
100100# gamepiece's position changes.
101- @onready var _follower : = $ PathFollow2D as PathFollow2D
101+ @onready var follower : = $ PathFollow2D as PathFollow2D
102102
103103
104104func _ready () -> void :
@@ -117,20 +117,20 @@ func _process(delta: float) -> void:
117117 # movement.
118118 # The excess travel distance allows us to know how much to extend the path by. A VERY fast
119119 # gamepiece may jump a few cells at a time.
120- var excess_travel_distance : = _follower .progress + move_distance - curve .get_baked_length ()
120+ var excess_travel_distance : = follower .progress + move_distance - curve .get_baked_length ()
121121 if excess_travel_distance >= 0.0 :
122122 arriving .emit (excess_travel_distance )
123123
124124 # The path may have been extended, so the gamepiece can move along the path now.
125- _follower .progress += move_distance
125+ follower .progress += move_distance
126126
127127 # Figure out which direction the gamepiece is facing, making sure that the GamepieceAnimation
128128 # scene doesn't rotate.
129129 animation .global_rotation = 0
130- direction = Directions .angle_to_direction (_follower .rotation )
130+ direction = Directions .angle_to_direction (follower .rotation )
131131
132132 # If the gamepiece has arrived, update it's position and movement details.
133- if _follower .progress >= curve .get_baked_length ():
133+ if follower .progress >= curve .get_baked_length ():
134134 stop ()
135135
136136
@@ -160,7 +160,7 @@ func move_to(target_point: Vector2) -> void:
160160func stop () -> void :
161161 # Sort out gamepiece position, resetting the follower and placing everything at the destination.
162162 position = destination
163- _follower .progress = 0
163+ follower .progress = 0
164164 curve = null
165165 destination = Vector2 .ZERO
166166
0 commit comments