Skip to content

move_towards_point

drewmccluskey edited this page Feb 10, 2019 · 4 revisions

move_towards_point

Move object towards a given position at a rate of pixels per step

Syntax:

move_towards_point(point, pixels)
Argument Description
Vector point Target position
double pixels Pixels to move per call

Returns: void

Description:

This function will move your GameObject to the given position by a number of pixels as specified.

Example:

move_towards_point(new Vector2(2, 0), 4);

The above code will move GameObject towards the left upper corner at a rate of 4 pixels per call.

Back to Movement

Clone this wiki locally