Script: Orbit

This script, when put in the Step event of an object, will make it orbit object0 (change object0 to the name of your object, or change the whole item to a point or whatever).

n=point_direction(x+sprite_width/2,y+sprite_height/2,**object0**.x-32+random(64),**object0**.y-32+random(64))
motion_add(n,1)
speed=min(speed,12)
image_index=floor(((n+5.625)mod 360)/11.25)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License