Bionic arm/Grappling hook

For questions about using Classic.

Post » Sat Aug 15, 2009 9:19 am

Please someone help me. How the heck do you make a grappling hook, like in Bionic Commando? I don't want anything fancy like realistic rope physics or anything. Just a simple grappling hook like Bionic Commando that shoots diagonally and connects to a wall allowing you to swing forward (and can also shoot upwards to cling to ceilings).

The thing is that I am really stupid and I can't figure out how to do things on my own worth a damn and this obviously requires some math which is something I fail at.

I have an amazing idea for a game that absolutely requires a grappling hook. The thing is I can't even get started on it because I can't even figure out how to make a grappling hook in the first place. An example or a .cap file would be nice. Anything to give me an idea of what I'm supposed to do.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Sat Aug 15, 2009 9:46 am

Id say probably the easiest way would be to use the line object.
I would try something like using a dummy sprite with the bullet behavior, then when you spawn the bullet, spawn a line at the same time, and have the start points set to an always event on the grappling gun. Then in the same always event have the endpoints of the line set to the bullet x,y.
When the bullet hits something destroy it and you will have your rope.
Now for the character movement you could do something like:
sprite set position to lerp(line.endx, sprite.x, somethingtimedelta), lerp(line.endy, sprite.y, somethingtimedelta). That will make it climb the rope, you can come up with some other movements like swinging from there.

edit:
Ok dont destroy the bullet, just deactivate, and reverse line end x,y with sprite x,y in the expression.
I always get that messed up. :P
Any way heres a cap:
[url:18o8jlrc]http://dl.getdropbox.com/u/666516/grapling.cap[/url:18o8jlrc]
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Aug 15, 2009 12:16 pm

Yeah, but the actual swinging part. Doesn't that require some advanced math? Honestly I've almost dropped out of school because of math, I really suck at it.

I mean, I remember someone mentioning this to me once:
http://en.wikipedia.org/wiki/Pendulum

And it has some sort of.. I don't even know what that is. Calculus? I never got that far in math. So this is like greek to me.

Or am I overthinking things a bit too much here?
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Sat Aug 15, 2009 1:11 pm

It depends on how complex you want it. For example, if you want your current speed to be transferred to your swing speed upon grappling, it takes a bit of complex math. However, a simple going back and forth is rather simple. I'm currently working on an example of the former.

EDIT: Also, just thought I'd mention; I don't think I have my original example anymore, but it was kind of crappy anyways, so it needed to be redone.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Sat Aug 15, 2009 1:48 pm

Not really, that is if you understand quarp at least. One way is to add a couple more dummies, and set one to rotate around your sprite, then have another to sit on the end of that sprite. You can then have the main sprite move to quarp(.x,line.endx,dummy2.x, somethingtimedelta).... ehh check the cap again i set it up.

Any way the timing is a bit off, and you probably need to have the rotation behavior only activate when its shooting, but you get the idea.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Aug 15, 2009 2:56 pm

It's not that difficult to make a NES style BC swing, but there are tons of ways of doing it. Since no physics or pseudo-physics are used, all you have to do is set up a rope object which shoots out of you, then rotate your grapple sprite around the grappled point, while setting your character to an image point on the other side of the rope. It requires no math! :mrgreen: (but you will have to set up a few variables to determine swing length and swing speed, also a grappled state for your character.)
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Aug 15, 2009 11:08 pm

Yeah, I played Bionic Commando NES and Bionic Commando Reamed again today and I noticed something I never noticed before.

The character swings forward the same amount of distance forward no matter how far you swing. Even swinging with a really short, almost retracted arm, kickstarted with the shotgun in BCR causes the character to swing forward at the same distance.

Something like that probably wouldn't be so hard to do after all. I think I have a better idea of what to do now, thanks everyone. I'm going to fiddle around with it some more and see what I can come up with.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Sun Aug 16, 2009 12:25 am

[quote="Davioware":m6astp77]It's not that difficult to make a NES style BC swing, but there are tons of ways of doing it. Since no physics or pseudo-physics are used, all you have to do is set up a rope object which shoots out of you, then rotate your grapple sprite around the grappled point, while setting your character to an image point on the other side of the rope. It requires no math! :mrgreen: (but you will have to set up a few variables to determine swing length and swing speed, also a grappled state for your character.)[/quote:m6astp77]

Huh?
An example?...Please.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sun Aug 16, 2009 12:27 am

There's also the apply elastic force action in the physics behavior
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Aug 16, 2009 12:38 am

[quote="newt":36fzwwct][quote="Davioware":36fzwwct]It's not that difficult to make a NES style BC swing, but there are tons of ways of doing it. Since no physics or pseudo-physics are used, all you have to do is set up a rope object which shoots out of you, then rotate your grapple sprite around the grappled point, while setting your character to an image point on the other side of the rope. It requires no math! :mrgreen: (but you will have to set up a few variables to determine swing length and swing speed, also a grappled state for your character.)[/quote:36fzwwct]

Huh?
An example?...Please.[/quote:36fzwwct]

Actually, I wouldn't mind one either. I think I get the idea though (keyword being I think) but seeing it in action would help.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests