move_towards_point(x,y,sp)
Jump to navigation
Jump to search
Description
Moves the calling instance towards the given point at the given speed.
Parameters
| Parameter | Data Type | Description |
|---|---|---|
| x | cs_scalar | x coordinate of the point |
| y | cs_scalar | y coordinate of the point |
| sp | cs_scalar | distance to move in a single step, in pixels |
Return Values
void: This function does not return anything.
Example Call
// demonstrates moving at 10 pixels a step towards the mouse
move_towards_point(mouse_x, mouse_y, 10);