Shoot and swing weapon from roap

0 favourites
  • 13 posts
From the Asset Store
Futuristic Weapons Vol 1
$7.20 USD
40% off
Futuristics Weapons Vol 1 includes 8 different weapons, in a total of 216 sounds
  • Am new to Construct2 and have been running in circles for a bit and figured it would be best to reach out. I am trying to create an action in a game that has a sprite (anchor) attached to another sprite (chain) that on the first click (A in the attached diagram) it shoots the weapon out with the chain attached, then when they press that same button (B in the diagram) it stops extending and drops like a swinging pendulum. I have tried a lot of custom movements, sine waves, physics, and pivot arms but cant seem to get it.

    Attached is a file I have been trying to get this to work on as well as a diagram showing what I described above.

    In the file you will notice I created an A and B button to easily map to the diagram but I would prefer for both actions to be done by clicking the same button twice.

    File

    neversettle.it/forums/weapon-swing.capx

    Diagram

    neversettle.it/forums/Untitled%20_6to7%20by%20UPAD%20Lite_06.png

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I dont have time atm to look into your capx. sry...

    But wanted to suggest a few links.

    Have you looked at Rex's plugin "swing"?

    and

    link to rex's wiki

    That might give you some of what you are looking for.

  • I made a very simple example without plugins, its just the movement.

    web example

    capx

    red one is button

    *if you dont have r150 beta

    here are the events

    <img src="https://dl.dropboxusercontent.com/u/7134196/hook/hook.jpg" border="0">

  • Thanks for both ideas, greatly appreciate it. They were both close but not exactly what I was hoping for, however they did inspire me to find the solution. See the capx file for it working.

    neversettle.it/forums/swinging-object.capx

    With that I now have two questions - how to the button release and launch to be the same button.

    Second, how to make the "chain" sprite more of a rope instead of a straight line. Trying to figure out how to give the "chain" a physics like property where it would bend like a normal rope or chain connected to a flying object. I was thinking I could maybe spawn many small lines and link them together through hubs somehow so that it appears to be a bending rope/chain but not exactly sure. Any ideas?

  • Have you looked into the pin behaviour? It has pin rope-style.

  • Yes, but cannot get it to work within my concept. Were you able to open the capx file? The rope has to extend from a pivot point and stay attached to another flying object. The rope then would need to have a rope like behavior vs just a rotating straight line. Can't get the pin behavior to accomplish this yet.

  • couldn't you use the straight line for the movement, set it invisible and use pinned rope style sprites to fake rope animation?

  • Not sure I exactly follow. The distance of the rope will always be different so how would I be able to pin a sprite and have it be the right size dynamically. I think we might be on slightly different pages, if you can take a look at the capx file it would probably help a ton. The file I provided a link to is stripped down to just this one movement.

  • I was thinking I could maybe spawn many small lines and link them together through hubs somehow so that it appears to be a bending rope/chain but not exactly sure. Any ideas?

    My reaction was aimed at this remark you made. I will download your capx tomorrow and see if my ideas could work within your setup. I think it will, although it might need some tweaking to get it to look exactly the way you want.

  • Thanks appreciate it, just have been playing with it and have not figured out how to make them spawn and connect into a longer line. The other key is that eventually (not shown in that file) the rope returns as well so they would need to destroy as they came back.

  • Hey LittleStain any updates - still hitting a wall on both of these issues - same button for fire and release and the rope. Any help is greatly appreciated.

  • I've been very busy working on my own project.

    Did make some attempts but wasn't working as well as I'd hoped.

    have an idea to fake it though, but will take some tweaking to get the feel..

  • This article is getting to the core idea its just lacking the ability to start with a short rope that starts one length and then expands until it collides with an object and retracts back to its original length.

    scirra.com/forum/realistic-rope_topic47808.html

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