Grappling Hook effect

For questions about using Classic.

Post » Sun Dec 13, 2009 1:47 pm

Hello! I have just started making a .cap with prototypes of all kinds of games/effects. The only thing i have in it now is Grappling Hook Test.

I want a rope/chain thingy to Grapple. Much like the blue laser/ghostkiller beam in The Rain(demo section) [url:angktbz5]http://www.scirra.com/construct/demos.php[/url:angktbz5]
How can i do this :?:
I have played the game but cant figure out how its done without a .cap to show

Any help would be...helpful.

EDIT: links dont work
B
18
S
2
G
4
Posts: 15
Reputation: 2,276

Post » Sun Dec 13, 2009 4:18 pm

A grappling hook is a pretty complex thing to create.

One simple way you might try is to draw a line (or stretch a sprite) from the player to the target. When the line or sprite reaches the target, make it shrink from the other end and set the player's position to the end of it.

Of course, that is a very simple method and it doesn't take into account swinging or collision, but you could expand on it from there.

You may not want to use Platform behavior for your player, especially if you want to swing back and forth. You're looking at some hard math involving sin and cos to do that.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Dec 13, 2009 10:37 pm

for swinging, make sure the hotspot (which should be in one extreme of the stretchable rope sprite) is set to the pivot, then set the size according to the distance between the player and the pivot and the angle according to the angle between them.

Now you can rotate the rope and set the player to the other end of the rope (an image point would do). I haven't given any thoughts to swinging speed, but you can probably take advantage of the Sin behavior, set to angle.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Jun 25, 2011 7:10 am

yay for necroposting! :D
was Rain cap ever released? who created it?
its unlogical for a tutorial to have just exe without cap.
B
16
S
5
G
4
Posts: 211
Reputation: 3,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests