Subject: Re: [stella] Collision detection From: Piero Cavina <p.cavina@xxxxxxxxxxxxx> Date: Fri, 05 May 2000 16:03:14 +0200 |
At 21.50 04/05/00 -0500, you wrote: >Here is an example. Air-Sea battle. I don't know if they used collision >detections, but here is how it may be done: > >Assume that each balloon/plane/boat is P0, reused every (let's say, I >didn't count) 16 or so scan lines. In order to tell which one of the >targets is hit, the program needs to read CXM0P and CXM1P every 16 lines >and then after dealing w/ that(probably saving to RAM), punching CXCLR. >This process needs to be done between every vertical segment that you want >to check for collisions between. There's a simpler way of doing this: remember that in a game like Air-Sea Battle each (pseudo)sprite has a fixed vertical position. You can check for collision between the missile and P0 just once in a frame, and select which target was hit just from the y-coordinate of the missile! misslY/16=index of the target that has been hit. I used a more elaborate version of this concept for Oystron (where there are two gun shots and targets that are pseudo-sprites in multiple copies). Ciao, P. -- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] Collision detection, Mark De Smet | Thread | [stella] PCAE 2.3 is out now, Paul Hart |
Re: [stella] What happened to "The , Andrew Davie | Date | Re: [stella] 650X Assembler, John K. Harvey |
Month |