[Tutorial]: Following a rope

Learn how to make certain types of games and use gameEditor.

[Tutorial]: Following a rope

Postby Hblade » Wed Jan 25, 2012 2:31 am

What inspired me to make this tutorial was I was watching a lets play of Mischief Makers, and decided.. hey it'd be cool to have a rope effect. So I came up with an incredibly simple way.

First: Download this rope graphic
Rope.png



Now lets begin! :) Add your rope graphic like so:
SSSS1.png

Now click the Path button and make a new path with these specs: (120 frames for this example)
SSSS2.png


Now, click the starting piece of the rope
SSSS3.png


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
SSSS4.png


Now finally, make the actor you want to follow on the rope.
SSSS5.png


Now your complete :D 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 :)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: [Tutorial]: Following a rope

Postby CoFFiN6 » Wed Jan 25, 2012 11:14 pm

Thanx man. I love picture tutorials :D
Don't run faster then the dragon, run faster than your friends :P
User avatar
CoFFiN6
 
Posts: 49
Joined: Sun Sep 11, 2011 8:17 pm
Location: South Africa
Score: 4 Give a positive score

Re: [Tutorial]: Following a rope

Postby Hblade » Thu Jan 26, 2012 2:35 am

Thanks xD Coulda made a video one but I was to lazy.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: [Tutorial]: Following a rope

Postby CoFFiN6 » Thu Jan 26, 2012 4:15 am

Most of the time I'm browsing GE on my phone and it no play no video .but its cool :D .its the code I'm after muahaha(evil laugh)
Don't run faster then the dragon, run faster than your friends :P
User avatar
CoFFiN6
 
Posts: 49
Joined: Sun Sep 11, 2011 8:17 pm
Location: South Africa
Score: 4 Give a positive score

Re: [Tutorial]: Following a rope

Postby Hblade » Thu Jan 26, 2012 8:56 am

XD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest