Drag and drop versus collision polygon for overlapping objec

Get help using Construct 2

Post » Thu Mar 20, 2014 7:49 pm

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
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Thu Mar 20, 2014 8:01 pm

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.
You do not have the required permissions to view the files attached to this post.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Thu Mar 20, 2014 8:46 pm

@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
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Thu Mar 20, 2014 10:01 pm

@Dasat - I had a little more fun with your example. ;)
You do not have the required permissions to view the files attached to this post.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Thu Mar 27, 2014 2:55 pm

@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
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Thu Mar 27, 2014 3:34 pm

Instead of setting opacity to 0 it's probably easier to set the sprite to invisible in it's properties..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Mar 27, 2014 5:05 pm

Here is the probe with the multimeter the movement isn't smooth though https://www.dropbox.com/s/ssc0t7dmc4so4 ... eMod3.capx
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Fri Mar 28, 2014 1:44 am

Dasat wrote:...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.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Mon Mar 31, 2014 11:26 pm

@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
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Mon Mar 31, 2014 11:59 pm

@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.

plugin-canvas_t64239?&hilit=r0j0hound

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.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Next

Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 8 guests