The Daily Click ::. Forums ::. Klik Coding Help ::. Question about collision coordinate
 

Post Reply  Post Oekaki 
 

Posted By Message

BeanKing



Registered
  28/04/2004
Points
  180
31st March, 2007 at 23:25:58 -

when two objects collide , how can i get the exact x,y that where they are touching each other ?

or anyother method is better for making the blood effect ?

thank you

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
1st April, 2007 at 07:15:44 -

There SHOULD be an extension out there (Advanced collision object???). I remember reading an extension description before that said something about that. Of course, this could be an April Fool's Day joke. That will be my cover for being so woefully incorrect.


EDIT: Hmmm, I was half on crack but maybe the Collision Object can help?

http://www.clickteam.info/extensions/

Go to the game objects section and it's the 4th or 5th one down.

Image Edited by the Author.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

BeanKing



Registered
  28/04/2004
Points
  180
3rd April, 2007 at 06:04:30 -

can i get it done by not using any extension ?

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
3rd April, 2007 at 07:45:23 -

Well, if objects A and B collide with each other, then if B is very small (a bullet for instance), then you could probably just assume that B hit A at B's X and Y coordinates. Then, you could store those coordinates relative to A's position, in one of A's alterable values.

I hope that makes sense, there might some better way to do it though. But what have you got against extensions? If there's an object that can do the job for you, then why not use it?

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
3rd April, 2007 at 08:05:46 -

Alternatively you could get the distance between them using:
(X2 - X1) = X Distance
(Y2 - Y1) = Y Distance
Then just create them from the object you want by creating an object off-screen and setting it's position to:
X => X("Active") + X Distance
Y => Y("Active") + Y Distance

Of course if you were doing a blood effect, you'd do this several times using a fastloop

 
My signature is never too big!!!

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
3rd April, 2007 at 08:46:33 -

Using the distance isn't that helpful because the position is taken from the hotspot. I am assuming the point you want is the actual collision point, which could be 2 irregularly shaped objects. If my hotspot was at the center, on a collison event, the blood or whichever object you are creating would be created at the center of the colliding object. Fine if your object is very small, but if you had 2 large objects it wouldn't really work. You could just make a 1x1 pixel object 'wipe' over your main object using a fast loop, since you know a collision would mean the colliding object is within the boundaries of the main object. If you passed an object that's 1 pixel only over the main object, you should be able to find exacly where on the object the collision has taken place by testing for an overlap with both the main object and colliding object. If you were talking about severity of a hit, you know a faster object is likely to be embedded more, so you would count more instances of the colliding object allowing you to "create more bloodz omg".

 
http://create-games.com/project.asp?id=1875 Image


Paul_James



Registered
  02/07/2002
Points
  1320
3rd April, 2007 at 12:11:50 -

i tried a couple of things, but didnt really hack out anything because im lazy.
I tried embedded collision detectors, didnt see a problem but there was scratched it.
I tried saving the y position of the bullet into an alterate value. It worked but if u smash the shift key fast, u wont see any bullets, just blood spurting out (cause the event to destroy the bullet). Didnt feel like working around it so scratch.
Tried a fastloop with a 4x4 invisible object moving down the player. That one worked the best.


 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...
   

Post Reply



 



Advertisement

Worth A Click