Pick up and throw objects with the same button

0 favourites
  • 10 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello all,

    I have my player pick up objects and throw them using the "X" button. I have the throw-able object behaviors set as the following. Physics, Pin and Bullet. Looking at some tutorials here on the Constuct 2 fourms I manage to make the player throw the objects. However of course, the throw and Pick up being set as the same button the Player instantly throws the object upon picking it up. Is there any way to set this as the same button like in games like Super Mario Bros. 2, Klonoa, Chip n dale for the NES? Or do I really need to make and alternative button for throwing?

  • Hey ChromeGadget,

    Would it work for your game to use the same button but have the pick-up and throw distinguished by whether the button is held or released? e.g. hold to pick-up the object, release to throw it?

  • Is this what you're after?

    Let me know with sqiddster if it doesn't work.

  • sqiddster

    Yes Sqiddster that's it, right on man! So far it's working fine just need to implement it into my engine. Thank you mate!

    space Ape

    Hey Space Ape

    Yea, I thought about using the hold button release to throw object feature in my game but the thing is I plan on making laser guns and cannons in my game as pick up objects. I don't want my player to constantly hold a button for long periods while trying to shoot (the shooting button being a separate button) It can be quite tedious at least in my standards. Thank you for your thoughts though Space Ape I appreciate it!     <img src="smileys/smiley32.gif" border="0" align="middle" />

  • Yeah, I'm still trying to figure stuff out, too.

    So what was the solution? I didn't get a chance to download sqiddster's capx file yet.

  • Glad it worked out for you.

  • sqiddster

    Hello again, I do have one small question regarding throw engine. I have successful implement the engine into my game. However, I am having difficulties changing the direction of the laser gun. I would like to have the laser gun face the direction the player is facing.

    On the "Is Carrying" I tried adding a code like "laserGun Set angle to PlayerMask.Angel degrees". It sorta work but when you press the left button or facing left the laser gun flips upside down. Can this be fixed some how?

        <img src="smileys/smiley29.gif" border="0" align="middle" />

  • ChromeGadget

    squiddster seems to be flown by the questions :D

    Don't worry , Your Awesome Game Dev Super-Whiteclaws is here to help !

    ...

    tip of today !

    You can do that in z easy steps !

    First of all , your gun need to be defaulted to the angle of the player ( By Default , the gun nozle needs to point toward the player view direction )

    Next , Add the following event to your game ( - = Sub-events , * = Action)

    Is Carrying

    • If Player.Angle = 0

    * Set Mirrored to Not Mirrored

    • Else

    * Set Mirrored to Mirrored

    And you are done !

    P.S. The Mirrored action can be found in the Gun Actions Section

    Cheers !

  • Yep, Whiteclaws is correct. If you set the angle it will naturally flip so just mirror it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hotdogit It worked!! Thank you Whiteclaws! <img src="smileys/smiley32.gif" border="0" align="middle" />

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