/*
Created by SpicyDeath82 / Opposing Forces Studios
this script allows you to have an object orbit another object
you place this in a step event(best in end step)
orbit_object(object,dist,orbitspeed);
*/
object=argument0; // the object to orbit
dist=argument1; // this gets multiplied against the sprite's dimensions
orbitspeed=argument3; // use a negative value for reverse direction
x=object.x+lengthdir_x(object.sprite_width*dist,orbitspeed)
y=object.y+lengthdir_y(object.sprite_height*dist,orbitspeed)
all the orbiting object does is jump to the right of the object it's supposed to orbit.how ever doing code snippets with this:
CREATE
orbitspeed=0;
STEP(end event)
orbitspeed=10;
x=object.x+lengthdir_x(object.sprite_width*dist,orbitspeed)
y=object.y+lengthdir_y(object.sprite_height*dist,orbitspeed)
the above works but isn't ideal as i want to use it as a simple script... any ides folks?
Edited by spicydeath82, 07 July 2010 - 08:50 PM.











