The Daily Click ::. Forums ::. Klik Coding Help ::. Grappling Hook
 

Post Reply  Post Oekaki 
 

Posted By Message

Logiq



Registered
  09/04/2007
Points
  120
30th June, 2008 at 15:18:01 -

I am making a ninja game for those of you who don't know. It's a 2d platform game and in this game I want my character to have a grappling hook (GH). The GH is going to model the grapple in the Tenchu game series, only a little different. The GH I want will lock on to predetermine spots on the level. The player will be able to select which one of these spot within his view by pressing left or right. Only the spots within the degrees of 35 and 85 will selectable. Once locked on the player will shoot the GH and it will reel him in just like in Tenchu or like Batman. Could anyone point me into the right direction? I've downloaded the double hook shot program but since it's not commented it is very confusing to dissect.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
30th June, 2008 at 15:52:52 -

I haven't played those games, do you mean like the hookshot in the Zelda series where the player wouldn't be affected by gravity while reeling in, or do you want it to be more realistic so the player starts to swing while reeling in?

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Logiq



Registered
  09/04/2007
Points
  120
30th June, 2008 at 16:15:30 -

Sort of like the Zelda hook shot but with a side view not the top down. The player would not be affected by gravity during that time. But if the player hit an obstacle or a enemy during the time he is being reeled in then the GH would be destroyed and he will have to try again.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
30th June, 2008 at 16:32:37 -

Oh, mine?

A simple way to do a reel in would be to have an active object (reel.active) that has a bouncy ball movement that always looks toward the hook. Then when reeling in, set the reel.active to the player position once, turn a flag on that makes the player stay with the reel.active, and it'll have the same effect.

OR you have to use a bunch of math.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
30th June, 2008 at 16:39:32 -

Well in that case you can do it the "easy" way. The most efficent way would be to use trigonometry, but I'm not to good with trig, though I know there's some good articles on it.

Try this one http://www.create-games.com/article.asp?id=1898

You can do it with the ball movement too, but that could get buggy since you have to switch between platform and ball movement. You're best off using the trig.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Logiq



Registered
  09/04/2007
Points
  120
30th June, 2008 at 17:07:01 -

Okay I don't like the ball movement Idea. And then again I don't know trig at all. I found the Trig formula that I needed in the article that you provided me. Are there any other documents that will help me along?

 
Hello guys! I'm New! -- I've been new for a year now...haha

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
30th June, 2008 at 18:01:45 -


Originally Posted by Marvel Forever
Just set the value A to -5 when the hook is overlapping a backdrop plus the button is being held. Not that hard.



What? What is Value A?

 
Craps, I'm an old man!

Logiq



Registered
  09/04/2007
Points
  120
30th June, 2008 at 18:30:35 -

I don't understand what you are getting at marvel. Can you please clarify what you meant?

 
Hello guys! I'm New! -- I've been new for a year now...haha

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
30th June, 2008 at 18:56:59 -

Even with the explanation of what GH was I still kept reading it as "guitar hero". Which reminds me, does the UK have guitar hero? Is it the same setlist? Anywho, on topic... Logig, depending on the style of game, Chansey made this really AWESOME chain engine that would be good for grappling hooks. It's not the actual hookshot, but it would make a cool looking chain. Ever play Goof Troop for the SNES? It's like that one attack the final boss does. It evenly distributes chain links between two spots. It's awesome. If you can't find it, I could upload the code... But I guess that's off topic.

 

  		
  		

Logiq



Registered
  09/04/2007
Points
  120
30th June, 2008 at 20:02:36 -

so what you mean is when the player has the lock on with the GH then to set the vertical value to a number to make him go up? That sounds like it could work but I want the player to be automatically reeled in. Sorry for not stating that. I'm using the platform object so what i am thinking is that I can pause the movement of the player and then position him 5px closer to the GH location, relative to himself course.

I am having trouble with the Lock on points for my Grappling Hook. I'm using the advance math object to get the angle of each lock on point compared to my player. I have it so that when the player is within a certain angle of the lock on point that it will turn on an internal flag. The problem is that when i do this all of my points flags are turning on and off at the same time. I know this is more of an object handling issue but for some reason it's not working. I set at the start of frame to Spread the value (ID) to all of the lock on points but MMF2 still toggles the flag at the same time.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Logiq



Registered
  09/04/2007
Points
  120
30th June, 2008 at 22:07:28 -

Okay Here's a progress report:


I have a Lock Point Object. This the the object that the player's crosshair will lock onto if the lock point is at a certain angle from the player (30-80 Degrees)

Each of these Lock Point objects has an internal flag that will turn on and off depending on the angle

Once the Player goes into the Grappling hook mode they will be able to select which Lock Point they will hook on to.

Here lies my current problem. When I press left I have the cross hair chooses it's target going to the left subtracting from a Lock Point ID value. and When I press right I do the reverse. If the Value goes below zero I just set the number to 1 but when I try to go the opposite way I have no number to refer to as the number of lock points will change in each level. So does anyone know how to grab the last number of a spreaded value? **Note** This spreaded value changes depending on when I enter the grapple mode. so a simple Number("Lock Points") will not do.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
1st July, 2008 at 09:19:13 -

does this help?

http://www.angelfire.com/mech/banshee/Grapple3.mfa
(copy & paste link - angelfire doesn't allow direct linking)

 
n/a

Logiq



Registered
  09/04/2007
Points
  120
1st July, 2008 at 12:13:35 -

So basically your not looking for the last number. you just add until you pass the amount of points. but the trick is that when you select one that is not available to instantly add the number to skip it. going all the way through until you get back to the beginning. Sweet thanks a lot Sketchy

 
Hello guys! I'm New! -- I've been new for a year now...haha

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
7th July, 2008 at 03:21:42 -

I'd say use Marvel Forever's method and make your own custom. Here's the thing you'd need to do though. Make sure that Gravity has its own grouping in the events. Then when the GH is over a background and the button is pressed, instead of using Y position, make a custom movement specifically for the grappling hook activate, and turn off the gravity group until the GH action is complete to assist in the creation of such a movement. Make the character look at the grappling hook and move towards it when the button is pressed and hook is over the background. That way you get both Y and X movement and it should swing him against the wall and reel him up.

Just a theory really, but it should work.


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
7th July, 2008 at 03:22:21 -

Rotten thing triple posted on me ... it wouldn't work for some reason and when it finally does it triples it. .. bah !

Can a Moderator please delete the copy post ?

.... I couldn't edit my original post because it triple posted and said can't edit because already replied to ...

so guess I have to add to this one ...

Here's an example file that I have made. A simple Grappling Hook method. Easy to understand and uses absolutely no math or extensions.

http://www.mediafire.com/?nedygndtxaz .......... http://www.mediafire.com/?nedygndtxaz ......... http://www.mediafire.com/?nedygndtxaz

I'm currently trying to figure out how to get it to swing. I think I'm going to need some sin/cosine and distance math for that. And I don't know how to do either, so expect a question from me soon.


Image Edited by the Author.

 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
11th July, 2008 at 01:42:21 -

Actually, i have a tutorial somwhere on my pc. I may have gotten it from here, but then i got bout everything available on here (almost everything). If i cant find the original tutorial link then i'll upload it maybe this weekend or next monday.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko
   

Post Reply



 



Advertisement

Worth A Click