Need a little help

Posted by Moikle on July 4, 2010, 12:36 p.m.

I am making a side scrolling, urban ninja/parkour game, and one of the game mechanics is the grappling hook.

I know grappling hooks are not simple but I thought I’d give it a try.

I’m aiming for something like the bungee levels on wOne 2

The rope needs to wrap around objects that it touches like this:

(Ignore the bubble in the top right, I’ve fixed that)

I think I have managed to make the rope wrap around objects, using two pairs of stacks, which should be the most complicated bit, but now I can't make the swinging motion.

This is what I have so far (, although don't expect to see anything without the swinging code):

here

I need to have it so the length can be changed, and it also needs to be able to get closer to the pivot point than the current length of the rope (so the rope is not a rod, preventing it from getting closer than its length.)

Most importantly, I need the pivot point to be moveable, as it needs to jump to each new (or old) wrap point.

I’ll try and put you in special thanks if I ever finish it (which is unlikely, but still…)

Thanks.

Moikle

Comments

Castypher 14 years, 4 months ago

First off, change your link to "hook.gmk", instead of "gml". Second, I'm getting errors about some "hk" variable when you're pushing the stacks in "char"'s creation event.

I've never played with stacks or any data structure besides maps, really. So for this I'd suggest something like a primitive, where you could divide the rope into separate parts, and half of them are on the wall while the remaining points are straightened out because of whatever physics you implement.

Seems like an ambitious script.

Moikle 14 years, 4 months ago

i don't know why that happens, i set that variable via the hook object right after char's creation.

but i will change the current scripts, i just need one for swinging.

Juju 14 years, 4 months ago

I will create you a swinging hook example but it will cost you your life.

Castypher 14 years, 4 months ago

Dead Ringer.

Juju 14 years, 4 months ago

Wha?

Moikle 14 years, 4 months ago

sounds reasonable juju

Avenger 14 years, 4 months ago

Dead Ringer = item in Team Fortress 2. You fake-die when you get hit with damage, and 8 seconds later you uncloak with a loud ZAP! So, if he is a pro in real life from Team Fortress 2, he will have a Dead Ringer Fake Watch that does not exist (like the cake, which is indeed a lie) and will feign death for the example.

Juju 14 years, 4 months ago

Aaah I see. I might get round to it.

Castypher 14 years, 4 months ago

Thank you, Avenger, for the elaborate explanation.