The Daily Click ::. Forums ::. Klik Coding Help ::. Collision object?
 

Post Reply  Post Oekaki 
 

Posted By Message

Duke Highway



Registered
  11/03/2010
Points
  21
12th March, 2010 at 01:05:43 -

Hi guys,

I need to find out the coordinates of a collision between two objects, ie at what coordinate(s) they collide.
Can anyone help with an extension or a way to do it without a special extension (shooting a one pixel object to the collision spot and get its coordinates is not fast enough)?
There was an extension called "Collision Object" which might be able to give me these coordinates. But I cant get it anywhere...

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
12th March, 2010 at 02:02:48 -

The collision extension was for MMF1 only, and hasn't been converted for use in MMF2. It was pretty complicated and sucky too, but I can send it you anyway if you want.

Why do you "need" the exact coordinates anyway?
Chances are, there's an easy alternative that will provide acceptable results, even if they're not perfect.

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
12th March, 2010 at 11:19:22 -

Thanks for the offer, but when the extension was for mmf1 only it has no use for me.
I want to make a mech game with top view and built in a laser pointer.

The laser pointer is a 2x2 pixel red dot which x-scale and angle are changed. When it collides with no obstacle it shall go through the whole screen, when it collides with an obstacle its x-scale shall be adjusted that it fits perfectly.
I solved the problem with the change of x-scale by multiplying it (for example *0.85 and 1/0.85) but its either too imprecisely or slow. With the exact coordinates I could use the Pythagoras and the problem was solved

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
12th March, 2010 at 13:46:00 -

why not just set to alt. vals to the x and y co-ords of the collision?? eg

objectA collides with objectB
set val a to X objectA
set val b to Y objectA

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
12th March, 2010 at 14:11:39 -

Does that work? I think that the values will be the coordinates of the laserdot (hot spot), which x-scale is changed and not the coordinates of the point of the collision...

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
12th March, 2010 at 14:14:37 -

He's talking about getting the precise point where the objects touch - not just the hotspot coordinates, which could be a long way away, or not available at all if the collision is with a background object.

As it happens, it wouldn't have worked anyway, for lots of reasons. For example, doing what he's doing, no "collision" would even be detected (only an overlap), plus the laser would often be overlapping several objects...

To be honest, he should be fine just using the normal fastlooped method - loads of people have used it for laser sights before and never had any trouble with slowdown.
btw: Make sure you're using the HWA version of MMF2.

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
12th March, 2010 at 17:03:52 -

kk, i'll try and give the fastloop method a chance...
thanx guys

 
n/a
   

Post Reply



 



Advertisement

Worth A Click