Re: [stella] Bounds test?

Subject: Re: [stella] Bounds test?
From: Piero Cavina <p.cavina@xxxxxxxxxxxxx>
Date: Sun, 07 Dec 1997 15:05:11 +0100
At 15.05 06/12/97 -0800, Greg Troutman wrote:

>Ruffin Bailey wrote:
>> 
>> >Rescue does both collision tests.  If the 2600 doesn't report the type
>> >of collision I'm testing, it just skips along, but if it does, then I
>> >bounds test to isolate which sprites/platforms are involved.

>You can (and many games do this) check the collision detection register
>repeatedly during the drawing of your screen, and know for a fact which
>copy of the player graphics was involved in a collision.

For those who are interested, Oystron does a mixed hardware and bounds
collision detection too.
You may have noticed that the playfield is divided into 8 horizontal zones.
The kernel loops from 7 to 0 to draw these zones. Before each iteration,
the collision registers are cleared, and after 16 scanlines - that is after
drawing each zone - the registers are checked and the results "ORA-ed" with
memory.

Then, there's a routine in VBLANK to handle the collisions of shots vs.
enemies; if a shot has collided with something, then the objects that were
in the same zone must be "modified" in some way. Please note how much
easier this is in Oystron, since any object (except the player) has only a
0 - 7 zone number, not a real Y-coordinate!!

If the object is a multiple-copies one, than a X-bounds check is done to
determine which copy as been hit exactly and what actions are to be taken.
Thougt it wasn't so easy to think, the resulting code is rather linear and
compact, and it works very well as you can see playing the game. I love
that part of the code! :-))




--
Stella list is Administered by krishna@xxxxxxxxxxxx <Glenn Saunders>
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
+-shameless plugs-------------------------------------------------------+
| Stella documentary at http://www.primenet.com/~krishna                |
| Nick's VCS links via http://www.primenet.com/~nickb/atariprg.htm      |
| Write the best game, win framed autographs of famous Atari alumni!!   |
+-----------------------------------------------------------------------+

Current Thread