153
« on: September 13, 2015, 02:37:34 PM »
Alright, I've got some tricks up my sleeve for that. I'll just modify the original message into this post.
in the object getting sucked in, put this in the create event:
radius=point_distance(x,y,blackhole.x,blackhole.y);
angle=point_direction(x,y,blackhole.x,blackhole.y);
speed=(maximum speed you want) / (maximum distance from the object) * point_distance(x,y,blackhole.x,blackhole.y);
step event code:
x=blackhole.x+(radius*cos(degtorad(angle)));
y=blackhole.y+(radius*-sin(degtorad(angle)));
angle+=(rotation speed here);
speed=(maximum speed you want) / (maximum distance from the object) * point_distance(x,y,blackhole.x,blackhole.y);
radius-=speed;
if point_distance(x,y,blackhole.x,blackhole.y)<speed{instance_destroy();}
If you want it to lose alpha as it approaches the object, put this in the step event too:
image_alpha=1-(1/(maximum distance from the object)*point_distance(x,y,blackhole.x,blackhole.y));
If you want it to lose rotation speed as it approaches the object, replace the angle+=(rotation speed here) code with:
angle+=(maximum speed you want) - ((maximum speed you want) / (maximum distance from the object) * point_distance(x,y,blackhole.x,blackhole.y));
That should be it. If there's a bug, post it.