Path: chuka.playstation.co.uk!news From: yaroze@theburrow.co.uk (Barry & Robert Swan) Newsgroups: scee.yaroze.beginners Subject: Re: Collision Detection!.....(Joy) Date: Thu, 24 Jun 1999 22:59:45 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 29 Message-ID: <3772b792.14736242@www.netyaroze-europe.com> References: <7kdntq$4fj13@chuka.playstation.co.uk> <376d3500.12938268@www.netyaroze-europe.com> <7kqf2d$qpv1@chuka.playstation.co.uk> NNTP-Posting-Host: pF8s07a01.client.global.net.uk X-Newsreader: Forte Free Agent 1.11/32.235 well, my two example bits of code were a bit unrelated (blushes). the first part was just for creating a 1bit mask (It should really be called 1 bit all along). and would take the scrolling of the sprite into account already (i think, cant remember and too lazy to check!) The second was slightly different; iamge you had 2 16x16 masks for each sprite when aligned to an x multiple of 8. The routine would take in any x and y for each of these two sprites and compare that; ie if you have 200 bullet sprites, you wouldnt need to create a mask for each one, just have one pixel aligned version and then use that mask by bitshifting to replicate the sprites true x position (which may be 8pixel aligned or not). Does that make sense? I wasnt really clear about the whole thing to be honest! Sos, Rob >Surely you do not need to use any shifts to detect the results of anding the >two images? I would have thought it would be quicker to check the ints or >longs for TRUE as any value other than zero is true. Going back to the >original idea of the array containing a 2 bit area of the screen size with >the two 2 bit masks anded on as per instructions ;) The following function >will check it far quicker than using shifts. Oh, this routine assumes the >screen res is 320x256 :)