ImagesCollide2 Slowdown?
BlitzMax Forums/BlitzMax Programming/ImagesCollide2 Slowdown?
| ||
When I use ImagesCollide2 to check collision detection my code starts to slow down after a new minutes. If I comment out the ImagesCollide2 and use only the distance this problem does not surface. Any ideas? if (pTMissile.GetStarship() <> pTStarship) 'Calculate the Distance between the Missile and the Starship. fDistance = sqr( ((pTMissile.GetX() - pTStarship.GetX())^2) + ((pTMissile.GetY() - pTStarship.GetY())^2) ) if fDistance < 50 If (ImagesCollide2(pTMissile.m_pTImage, pTMissile.GetX(), pTMissile.GetY(), 0, pTMissile.GetAngle(), .5,.5, pTStarship.m_pTImage, pTStarship.GetX(), pTStarship.GetY(), 0, pTStarship.GetAngle(), .5,.5) = True) Then pTMissile.Destroy() End If end if end if |
| ||
Sounds like you are missing a FlushMem call in your main loop. |
| ||
Thanks, that seemed to do it! |