Space Station 13 - Modules - TypesVar Details - Proc Details

move_towards

Used as a alternative to GLOB.move_manager.home_onto

Vars

homeShould we track our target, so we won't end up in the wrong place if it moves or if something knocks us off course?
x_speedThe speed at which we move along each axis, between -1 and 1

Procs

update_angleRecalculates the angle we're moving at, so that we get a smooth movement line, rather than awkwardly bending from orthogonal to diagonal (or vice versa) at some point.

Var Details

home

Should we track our target, so we won't end up in the wrong place if it moves or if something knocks us off course?

x_speed

The speed at which we move along each axis, between -1 and 1

Proc Details

update_angle

Recalculates the angle we're moving at, so that we get a smooth movement line, rather than awkwardly bending from orthogonal to diagonal (or vice versa) at some point.

The way we set the angle is by adjusting the speed we move in each direction. We always move at full speed along the longer axis towards our target. For the other axis, we calculate the right speed to reach our target at the same time we did on the longer axis. The net result is that every time we move, we approach the target along the longer axis, but we only move along the shorter axis at regular intervals, creating as smooth a line as possible.