How to pull an object using a grappling hook?

0 favourites
  • 6 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hi all,

    I'm making a grappling hook-based game that allows the player to pull blocks toward the player. Right now I have 2 issues I can't fix:

    1.) Moving a block after the grappling hook attaches to it.

    2.) When the grappling hook is shot vertically, the hook will not return to the player but instead fly off at a right angle.

    I'm stumped because I tried using the 8-way behavior with the block, since it works with moving the player object around just fine when I grapple to walls/ceilings.

    For the second issue the grappling hook has bullet behavior, but I have no problem with firing bullets up and down, just the return trip is acting oddly.

    Here is a capx file with what I have so far.

    mediafire (dot) com/file/qvzxbb70egiabiv/grapple_proto_01 (dot) capx

    Thanks for your time!

  • Ok so an update on my grappling hook. In the block's behavior options, I had set "Initial State" to disabled, and re-enabling it allowed me to freely control the block with events. So number 1 seems to be fixed now.

    However, I'm still confused as to why my grappling hook, when shot downward, shoots off to the side after colliding with the block. The only command I had set was to change the bullet's speed to [-1000] so it would go backwards. I did not change the bullet's angle, and it seems to work just fine when pulling the block from the side.

    Here's an image of the my issue.

    imgur (dot) com/a/1eev4vh

  • Why do you use Platform and 8-direction behaviors on the same objects? I don't think they work together well.

    I would suggest moving the character and blocks using Platform actions only.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I used both because I wanted the top speed for the player using Platform behavior to be lower than the top speed for the 8-direction. Since I use 8-direction for grappling I can move the player around at a faster speed than if the player walked around using the Platform simulation.

    Honestly the only reason I used the platform behavior in the first place is because I wanted gravity to affect the objects and I was unsure how to implement that with 8-direction.

    EDIT: If there was a way to cap the walking speed but still be able to zip the player around at a faster speed using the Platform behavior then I'd love to learn that.

  • 8-direction is mostly used in top-down games. Frankly, I have never seen Platform and 8-direction being used together in one object.

    You can change the maximum Platform speed with events. Set a higher speed when grappling, then reset back to normal walking speed.

  • Thanks to your suggestion, I eventually figured how to everything using the Platform behavior!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)