datsuper7 wrote:
say you were making a game with heaps of different bosses to kill,how do you hide their health. I've tried lots of things but I don't know how.
Please help!
I would only display one Enemy Health variable and use it over and over for whatever Boss you happen to be fighting at the moment. This assumes that you are never going to be fighting more than one Boss at a time!
Another approach is not to show a health variable at all. Instead, have the enemy change costumes to show more damage. This way you can show health on any number of enemies at once. The costumes could include a Health Bar floating above the enemy if you wanted to stick with a gauge or meter.
Last edited by Paddle2See (2008-05-15 07:00:14)
Offline
OR: You can click the link in my signature and click Moon Theif to see a custom score display using sprites, OR Paddle2see can show you there project about doing that
Offline
Paddle2See wrote:
Another approach is not to show a health variable at all. Instead, have the enemy change costumes to show more damage.
Example: http://scratch.mit.edu/projects/twist/2005
Offline
fergi2610 wrote:
go to variables and one of you variable bricks shoud hav a check box. uncheck and.... tada!!! ther is no variable on the screen
I think he wants to hide/show them while playing the game. This would be very convenient if they had these hide/show blocks for variables, but alas, they don't exist. You must cover them up with another sprite.
Offline
Yeah, I try to use anything but the generic red readout wherever I can. The_Guardian has implemented a variable stamper [url=http://scratch.mit.edu/projects/the_guardian/161167[here[/url]that looks pretty useful. Alternately, you could have a health bar that hovers above the enemy you are
engaged with. (That sounded weird). This would involve a script that would either involve a target that "jumps" from enemy to enemy or something like this:
For the stage:
When flag clicked:
Set enemyCount to 0
broadcast countEnemies and wait
broadcast startGame
----End of Stage Scripts----
For each enemy:
When I receive countEnemies:
Change enemyCount by 1
set myIndex# to enemyCount
When I receive startGame:
Forever:
Wait until <touching goodGuy?> and <inCombat=1>
set combatEnemy to myIndex#
set healthBarX to (x position)
set healthBarY to (y position+40)
set healthBarHealth to myHealth
broadcast changeHealthBar
wait until not touching goodGuy?
This is just code for the health bar sensing. It won't do anything else.
----End of enemy code----
For the main character (referred to as goodGuy):
When I receive changeHealthBar:
go to x: (healthBarX) y: (healthBarY)
switch to costume healthBar (Here you would have to have a costume for each amount of health an enemy can have)
----End of health bar scripts----
Finally, be sure to set inCombat to 1 whenever you want the health bar to show. Hope this helps (It probably won't , maybe I'll make an example project.)
Last edited by fullmoon (2008-05-20 19:41:38)
Offline