Path: chuka.playstation.co.uk!news From: "Rad" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: 2d collision bounding box... Date: Mon, 7 Dec 1998 23:44:23 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 70 Message-ID: <74hp72$8bc3@chuka.playstation.co.uk> References: <366C2C7E.75028A95@club-internet.fr> NNTP-Posting-Host: vil-49.village.gre.ac.uk X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Hi Chris, What you are looking for is pixel-perfect collision detection rather than the bounding box method. However even though this method is much more accurate it's also a lot slower because instead of testing each rectangle for collision you have to test each pixel instead (and there a lot more pixels!). I'll get around to coding some collision detection during the christmas holidays so untill then I can't really help you out, but my suggestion would be to check out the source code to James Shaughnessy's excellent Gravitation (http://www.netyaroze-europe.com/~shaughnj/ftp/gravsrc.zip) which uses pixel-perfect collision detection. Hope this helps, Rad. rad@cyberdude.com http://www.netyaroze-europe.com/~radpsx cros wrote in message <366C2C7E.75028A95@club-internet.fr>... >hi. >Ok,when i want to detect collision between sprites i use bounding boxes >rectangle following my sprite. >In my case, that is: > >i have a ship(i make a space invaders for training me to C ...)like >this(approximatively!!): > > i > iiii > i iiiiiii i <----This is the ship(fabulous >isn't it?) > iiiiiiiiiiiiiii > iii iii > > >i have a super-laser-bullet like this: > > the laser---> 0 <----(i can believe my eyes! >this laser-bullet is so terrific) > > >How can i make this collision operations between this two objects?: > > > > > > i > iiii 0 > i iiiiiii i ----->here no collision > iiiiiiiiiiiiiii > iii iii > > > i > iiii > i iiiii0 i ----->here, there is collision > iiiiiiiiiiiiiii > iii iii > >Like you can see on my terrible ASCII graphics, the bounding box method >don't works, how can i do? > >Chris >