Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ucsd!sdcc6!sdcc8!cs178abu From: cs178abu@sdcc8.ucsd.EDU (John Schultz) Newsgroups: comp.sys.amiga Subject: Re: collision detection Message-ID: <815@sdcc8.ucsd.EDU> Date: 11 Mar 88 08:12:04 GMT References: <893@astroatc.UUCP> Reply-To: cs178abu@sdcc8.ucsd.edu.UUCP (John Schultz) Organization: University of California, San Diego Lines: 26 Keywords: does it work? The hardware collision registers work only for certain pairs of hardware sprites. I have written a few games for the Amiga, and don't use the system animation routines; they are too slow. In "Libyans In Space" I used a simple "proximity" algorithm for animation done using BltBitMap(). In "TacoRama!" (soon to be released), I used hardware sprites and used the hardware collsion registers. TacoRama! was simple enough to allow me to choose the pairs that would work for hardware collisions. The runtime overhead for algorithmic collision detection is quite small. I would recommend using that approach for anything sufficiently complex (more than the hardware registers can handle). Here is the simple algorithm I use: PROCEDURE proximity(targetx,targety, missilex,missiley : INTEGER; targetw,targeth : CARDINAL): BOOLEAN; BEGIN RETURN (ABS(targetx - missilex) < INTEGER(targetw)) AND (ABS(targety - missiley) < INTEGER(targeth)); END proximity; John