Thanks Tedd & Robert, Testing the two rects, rather than creating a region, works a treat. Cheers Bernie *** Original message *** >> Hi Everyone, >> >> During animation, I check for collision by creating a region for one of my >> moving objects and rects for others with FN RECTINRGN. >> >> Is it safe to repeatedly call the following to create a new region each time >> the object moves or should I be disposing of the region handle before >> creating a new one? >> >> humRgn = FN NEWRGN >> OPENRGN >> SETRECT(rgnRect,gHumRect.left,gHumRect.top,gHumRect.right,gHumRect.bottom) >> FRAMERECT(rgnRect) >> CLOSERGN(humRgn) >> >> Any advice appreciated. >> >> Cheers >> Bernie > > Like Tedd suggested, I would just dispose of it first. > > if humRGN <> 0 then DISPOSERGN(humRGN) > > and go about your business. > > There may be easier ways to handle what you are doing though. > > If you are tracking sprites, you can just check the sprite's rects for > intersection at any given time using > > hit = FN SectRect(testRect1,testRect2,iRect) > > If your items are intersecting, then hit will be _True, and the > intersecting area will be in iRect. > > Otherwise, you will get a value if hit= _False. > > This avoids the need to create a region. > > Robert