Jump to content
Retro Lord

Healthbar, 2 colors?

Recommended Posts

Is it possible to have the healthbars in 2 colors? I'm sure I've seen a game before that had a lifebar/timebar that was one color and as it decreased the amount decreased turned red.

Share this post


Link to post
Share on other sites

Dunno what you're using to draw, but if it's with PF graphics you can set the PF to score mode. To make the left/right two different colours.

Share this post


Link to post
Share on other sites

Activision games.

I think they write the color information to the coluBK as it about to draw the bar. When the bar's finish drawing, then load the old color information back. They use the ball for smoother diminishing meter. Then repeat the process to make the bar taller, then starts preparing to draw whatever below that bar. Something that can be done in asm.

Share this post


Link to post
Share on other sites

I don't know if you can do this with bB, but what I would do is:

  • set COLUP0 to the 1st color of the healthbar (say green)
  • set NUSIZ0 to $08, makes player0 quad size
  • set GRP0 to $FF
  • set CTRLPF to $05, reflected and playfield has priority (so the player hides behind it)
  • draw the playfield by setting PF0 = $FF, PF1 = $FF, PF2 = $0F, you'll have a 32 pixel "hole" in the middle of the screen
  • set COLUPF to your game's normal background color
  • set COLUBK to the 2nd color of the healthbar (say red)
  • for full health, position player0 so that it appears entirely in the 32 pixel playfield hole
  • for partial health, position player0 to the left based upon how much health remains

Share this post


Link to post
Share on other sites

Minor changes to show two 2 color healthbars side-by-side on the same scanlines:

  • set COLUP1 to second healthbar's 1st color
  • NUSIZ1 = $08
  • GRP1 = $FF
  • PF0 = $FF, PF1 = $00, PF2 = $FF, you'll end up with two 32 pixel holes
  • position player0 in the left hole
  • position player1 in the right hole

Share this post


Link to post
Share on other sites

Yeah. My game MMSBC 2 uses the flicker technique. It's really, really hard to get it right. Especially since each TV seems to handle flickering a bit differently.

 

post-13304-0-48273600-1360688784_thumb.jpg
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...