Drag and drop versus collision polygon for overlapping objec

0 favourites
  • 11 posts
From the Asset Store
Now you can drop everything in your game with sound :)
  • I have this probe i want to to use to trigger an event only when the tip of the probe overlaps a line, the probe has a drag and drop behaviour, thus i can't afford restricting the collision polygon to the tip alone, else you have to drag with the tip alone, how can i solve this issue, capx file is attached to illustrate the problem. thanks for the help in advance.https://www.dropbox.com/s/sqp6v8t1nqu3o8l/probe%20challenge.capx

  • Here you go. I only did it for the black probe.

    Basically what I did was create an imagepoint at the tip of your black probe. I created a new Sprite called negHit. At the start of the layout I moved negHit to the imagepoint and pinned it there by position. I also changed negHit's opacity to 0 so that it's there but you don't see it. So then I changed your testing of when the probe is over the wire to when negHit is over the wire.

  • shirokuma thanks a lot, all i was seeing was a collision polygon challenge so i couldn't even think that image point could solve it, thanks a lott

  • Dasat - I had a little more fun with your example.

  • shirokuma, wow, this was the next challenge i was to start racking my head to fix, thanks a lot, would see, how i can incorporate it to my project and pin it to the actual multimeter image

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instead of setting opacity to 0 it's probably easier to set the sprite to invisible in it's properties..

  • Here is the probe with the multimeter the movement isn't smooth though https://www.dropbox.com/s/ssc0t7dmc4so4 ... eMod3.capx

  • ...the movement isn't smooth though

    Are you talking about how the probe swings wildly when it's dragged near the starting point of the wire? Or is there another issue?

    If it is the issue you could disable the lines of code that rotate the black probe towards the starting point of the wire. So the probe would always stay at it's original angle.

    You might also consider moving the multimeter so that you are not trying to probe a point right next to it.

    If you don't want to move the multimeter you could stop adjusting the angle of the probe when it's within a certain distance of the multimeter.

  • shirokuma, Not necessarily those issues, im hoping i can get an effect similar to what they have here http://phet.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp when i drag my probe around. note that the lenght of the wire is actually constant and the wire just bends a little depending on the path the probe followed

  • Dasat

    I think the length of the probe lines are not constant. If you place the meter in the lower left you can drag a probe to the upper right (and beyond). The length of the line seems longer to me.

    I think everything in hat Java app looks doable in C2. I think you are going to need to use something like this plugin to accomplish those lines.

    I haven't played around with this plugin too much, but it does have bezier curves, which is what I think you will need for those curved probe lines.

  • shirokuma, thanks would check it out and work on it.

    Dasat

    I think the length of the probe lines are not constant. If you place the meter in the lower left you can drag a probe to the upper right (and beyond). The length of the line seems longer to me.

    I think everything in hat Java app looks doable in C2. I think you are going to need to use something like this plugin to accomplish those lines.

    I haven't played around with this plugin too much, but it does have bezier curves, which is what I think you will need for those curved probe lines.

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