First: Download this rope graphic
Now lets begin! Add your rope graphic like so:
Now click the Path button and make a new path with these specs: (120 frames for this example)
Now, click the starting piece of the rope
Click to create a new dot along the rope. The more dots you have the higher accuracy. If you have a rope with a ton of curves your gonna need a lot of dots. :3
Now finally, make the actor you want to follow on the rope.
Now your complete Click game and watch the actor follow the rope.
If you want to get even more advanced and have the actor fall off the rope, then you'd add an event - path finish -
- Code: Select all
directional_velocity=10;
ChangePath("Event Actor", "(none)", BOTH_AXIS);
For accurate speed after stopping, use a calculator to determine the actual velocity he was going. Or you could save his directional velocity to a variable then use that. For example, have a variable called PATHON, and do an if statement in draw actor where if PATHON is equal to 0, (make a new variable called VAR1). VAR1=directional_velocity. Now after the path finish, you'd do PATHON=1; then do directional_velocity=VAR1 then the change path code. That should keep his velocity.
Example:
I used an array for this. Create a new variable, click "yes" to array, make it a size of 2. Name it v. Place this code in Draw Actor of the actor following the rope.
- Code: Select all
if (v[0]==0)
{
v[1]=directional_velocity;
}
Now at path finish:
- Code: Select all
v[0]=0;
directional_velocity=v[1];
ChangePath("Event Actor", "(none)", BOTH_AXIS);
Hope this helps