Jump to content
IGNORED

How to do "Energy bars"?


Recommended Posts

How is it possible to implement "Energy Bars" like on Kung Fu Master (or a zillion other games)?

 

The bars are always quite wide and have very small (sometimes 1 pixel) decrements when you lose energy. They are also 2 colours - one colour for "available energy" and one for "depleted energy" with a different background colour.

 

How is this done? I tried implementing it with playfield lines, but the time taken to change colours mid-scanline means that one decrement takes away half the bar! Whats the secret?!

Link to comment
Share on other sites

Ahhh ha! Combination PF (like I had done) with the Ball used for the "fine" decrements... Great tip, thanks Thomas!

I did six "status bars" near the top of the following screen using missiles-- three copies of missile0, and three copies of missile1-- and then used color changes to COLUP0 and COLUP1 to get the levels for each bar, with each bar's level controlled by a variable.

 

Michael Rideout

 

post-7456-1150893946_thumb.jpg

Link to comment
Share on other sites

Yeah, but thats cheating - vertical energy bars! :)

What is that game you made? It looks cool!

 

Actually Thomas' nifty suggestion has ended up giving me more questions then answers! On Kung fu master, disabling both player 1 AND player 2 sprites turns off more things than turning off player 1 or 2 individually! For example, there are 5 decorative swirly things at the bottom of the screen. Turning off player 1 erases decorative things 3 & 4. Turning off player 2 disables 1 & 5 (neither disable 2!). Turning off both player 1 & 2 erases all of them.

 

Why is this?! Its causing me great pains in figuring out the energy bar mystery :)

Link to comment
Share on other sites

:idea: z26 and Stella have hotkeys, which allow you to disable selected objects (e.g. player 0 or playfield). Experiment with those hotkeys and most tricks do become very obvious.

What are these hotkeys in Stella? I've scoured through both documents (general and debugger), but can't find anything that mentions this feature in Stella. :?

 

Michael Rideout

Link to comment
Share on other sites

Yeah, but thats cheating - vertical energy bars! :)

What is that game you made? It looks cool!

That screen isn't part of a working game, it was just a static display I made while I was trying to work out the kernel for my "Quest for the Lost Pyramids of Atlantis" game a couple of years ago. That project is currently on hold, and never got much past a few static test screens and a pair of working title screens (the first title screen says "Quest for the Lost Pyramids of Atlantis," and the second title screen says "Part I: The Lost Pyramid of Eqypt"; they cycle between each other every few seconds). I was creating the game using the M-Network 16K bankswitching with extra 2K RAM, and the display data for the kernel is stored in the extra RAM. When I eventually resume working on the game, I'm planning to use supercat's bankswitched cartridge with extra RAM. :)

Actually Thomas' nifty suggestion has ended up giving me more questions then answers! On Kung fu master, disabling both player 1 AND player 2 sprites turns off more things than turning off player 1 or 2 individually! For example, there are 5 decorative swirly things at the bottom of the screen. Turning off player 1 erases decorative things 3 & 4. Turning off player 2 disables 1 & 5 (neither disable 2!). Turning off both player 1 & 2 erases all of them.

 

Why is this?! Its causing me great pains in figuring out the energy bar mystery :)

The only thing that makes sense is that there are three copies of both players, with player 0 starting where the second swirly is, and with player 1 starting where the fifth swirly is. That is, the first swirly is the second copy of player 1 (I'll call it "P1B"); the second swirly is the third copy of player 1 (P1C) as well as the first copy of player 0 (P0A), positioned precisely on top of each other; the third swirly is the second copy of player 0 (P0B); the fourth swirly is the third copy of player 0 (P0C); and the fifth swirly is the first copy of player 1 (P1A); as follows:

[font=Courier New]
P1B	  P1C						P1A
	  P0A	  P0B	  P0C

Michael Rideout

Link to comment
Share on other sites

What are these hotkeys in Stella? I've scoured through both documents (general and debugger), but can't find anything that mentions this feature in Stella. :?

'Alt/Shift-Cmd' z, x, c, v, b, n keys to enable/disable the P0, P1, M0, M1, BL, PL bits in the TIA, respectively.

Link to comment
Share on other sites

What are these hotkeys in Stella? I've scoured through both documents (general and debugger), but can't find anything that mentions this feature in Stella. :?

'Alt/Shift-Cmd' z, x, c, v, b, n keys to enable/disable the P0, P1, M0, M1, BL, PL bits in the TIA, respectively.

Well, those are the Alt keys used by Z26, and I had tried them on Stella (2.2 I think, or is it up to 2.3 already?), but it didn't do anything in Stella. So when you say "Alt/Shift-Cmd," are you saying I have to hold down Alt, Shift, and Cmd (which I presume is the Windows key?) all at the same time when I am pressing z, x, c, v, b, or n? And where is this documented in the Stella docs so I don't have to keep asking dumb questions? :) Thanks!

 

Michael Rideout

Link to comment
Share on other sites

Well, those are the Alt keys used by Z26, and I had tried them on Stella

Both use the same keys. Under Windows use ALT+key (the other ones are probably for other OS).

Weird! I tried that last night in Stella 2.2 and it didn't work, but tonight it's working! :?

Documentend in changes.txt.

Okay, I didn't look there, I looked in the two HTML documents. Thanks again!

 

Michael Rideout

Link to comment
Share on other sites

Well, those are the Alt keys used by Z26, and I had tried them on Stella

Both use the same keys. Under Windows use ALT+key (the other ones are probably for other OS).

Weird! I tried that last night in Stella 2.2 and it didn't work, but tonight it's working! :?

Yes, the keystrokes for Windows/Linux/most other OS is Alt-xxx, where you hold down the Alt key and press 'xxx', which is one of the keys mentioned in a previous thread. For OSX, the same commands are activated by holding down Shift and Command, and then pressing the aforementioned keys.

Documentend in changes.txt.

Okay, I didn't look there, I looked in the two HTML documents. Thanks again!

Oops, this was supposed to be included in Section 8 of the main manual, under the Keyboard Settings. This will be fixed for the next release.

 

Also, the key combos were chosen to be the same as z26 for less confusion. And there are another two keys that haven't been mentioned:

 

'Alt .' - disable all TIA bits

'Alt /' - enable all TIA bits

 

In the future, 'Alt m' and 'Alt ,' will be added as part of 'Alt n' to disable specific parts of the PF (right now, all three parts are disabled at once).

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