Jump to content
IGNORED

Healthbar, 2 colors?


Retro Lord

Recommended Posts

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.

Link to comment
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
Link to comment
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
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...