|
Post by OddChild on Nov 28, 2006 12:24:48 GMT -5
i think it would be neat if there was some way to determine a collision between a sprite and an FX. Also, to enhance it... it would be neat to know how much of a collision. After an explosion, it would be useful to know how much of the explosion it hit. IE being close to where the FX is the brightest v.s dimmest. Another example would be, being able to tell how intense the fire, or thruster was when the sprite touched it.
|
|
|
Post by Guilect on Nov 28, 2006 20:46:28 GMT -5
For now you can calculate the distance from your image to the FX. Then adjust the images health (for example) depending upon how close they are to the FX.
Function GetDistance(X1, Y1 ,X2, Y2) 'calculate distance 'between 2 points GetDistance = Sqr(((X2 - X1) ^ 2 + (Y2 - Y1) ^ 2)) End Function
' example system.debugPrint GetDistance(20, 20, 55, 333)
|
|
|
Post by OddChild on Nov 29, 2006 4:13:27 GMT -5
not just the distance.... but like how dense, the area was that the sprite collided. Thanks though
|
|