Page 2 of 2

Re: Create a spark at precise collision point?

Posted: Mon May 30, 2016 4:39 pm
Yes. R0J0hound's examples had a TileMap mechanism.

Re: Create a spark at precise collision point?

Posted: Mon May 30, 2016 5:07 pm
blackhornet wrote:granpa's code (almost) does it (brackets were in the wrong place):

x=(square1.x+square2.x)/2
y=(square1.y+square2.y)/2

oops.....I wrote that at 7 am my time on memorial day morning with one eye shut......

Re: Create a spark at precise collision point?

Posted: Mon May 30, 2016 5:49 pm
Zebbi wrote:
newt wrote:The simplest method would be to use dummy detector objects.

Yeah, thats what I'm thinking. Does pinning 4 detectors cause a big increase in resources?

Not unless you have a large amount of instances that need the dummies.

The most efficient method would be to make separate objects for the detectors, and put them in a container with the object.
Make as many image points as you need and label them sequentially, d0, d1,d2....
Then on creation make a loop and place them at imagepoint "d"&loopindex.

Re: Create a spark at precise collision point?

Posted: Mon May 30, 2016 9:52 pm
blackhornet wrote:Yes. R0J0hound's examples had a TileMap mechanism.

Trying this:https://www.scirra.com/forum/get-the-x-and-y-of-a-span-class-posthilit-collision-span-span-class_p1025697?#p1025697 adjusting the code to match my car, at the moment it's not resizing the masking box to the size of my car properly, and it's occurring on impact of the tile regardless of the tiles collision polygon, am I missing something?

Re: Create a spark at precise collision point?

Posted: Tue May 31, 2016 1:17 pm
Done, I created and pinned each detector sequentially in a big 16 piece event, pretty ugly but I'm not smart enough to do it with an efficient, dynamic loop :/