You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
drewmccluskey edited this page Feb 10, 2019
·
4 revisions
move_random
Sets a game objects position to a random position snapped to a defined grid
Syntax:
move_random(cellSize)
Argument
Description
vector cellSize
x and y grid cell to snap to
Returns:void
Description:
This function will move your GameObject to a random location in the room and then snap to the nearest grid cell based upon the vector size specified in the input. (0,0) will be a no-snap grid. This function is very useful when it comes to spawning enemies randomly or creating particle effects.
Example:
move_random(newVector2(32,32));
The above code will move the current GameObject to a random position snapped to a 32x32 grid.