What it does
math.getDirectionX reads DirectionX on a math object. It takes angle and speed.
Signature
math.getDirectionX(angle, speed)Arguments
anglespeed
Example · generated
function update(dt) { const directionX = math.getDirectionX(45, 1);}math.getDirectionX is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.