Re: [stella] Generating a health bar without ruining your health...

Subject: Re: [stella] Generating a health bar without ruining your health...
From: "Glenn Saunders" <cybpunks@xxxxxxxxxxx>
Date: Thu, 27 Sep 2001 11:41:34 -0700
The way I would do it is:

You start out with an asymmetrical playfield routine and you set up the bits to represent the coarse health (4 pixel chunks) and then you can fill in the gaps (1-3 pixels if necessary) with a sprite colored the same as the playfield. You'll have to do some math and/or have some tables to convert a number into a combination of playfield registers, horizontal sprite position and sprite data. I would align the sprite on the PF boundary and adjust the shape to use between 0 and 3 bits rather than actually overlaying it, so that when the health is near zero you won't be stuck with a sprite that's too fat to represent 1-3.

You should be able to get two health meters on the same scanline that way. You can position the missiles to draw a line representing the maximum health.

Here is a crude diagram:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx BLUE
XXXXXXXXXXXXXP0     M0       XXXXXXXXXXXXXP1    M1   BLACK (BG) RED (FG)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx BLUE

The blue scanline above and below help "frame" the space between the end of the health meter and the missile lines.

As the health deteriorates you can adjust the color registers, maybe shifting from green to yellow to red. There should be enough time to have the two health bars be independent colors, rewriting both the necessary playfield register and the COLUBK register.



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/

Current Thread