Discuss Scratch

Rickyickerson
Scratcher
18 posts

Health bars

How do I do Health bars? I'd like to know how to do it because I'm making a game that would be a ton better with health bars
awesome-llama
Scratcher
1000+ posts

Health bars

Make a sprite for the health bar. Give it multiple costumes, with varying levels of health displayed. Then simply have a loop to detect health from a variable, and set the costume accordingly.

Last edited by awesome-llama (Feb. 8, 2018 06:06:05)

Gudo
Scratcher
28 posts

Health bars

Rickyickerson wrote:

How do I do Health bars? I'd like to know how to do it because I'm making a game that would be a ton better with health bars

Like awesome-llama said make multiple costumes and a
(health)
variable then something like
forever
if <[80] <(health)> then
switch costume to [above 80%]
else
if <[60] < (health)> then
switch costume to [above 60%]
end
end
just keep repeating those steps using if else… (of course depending on how many costumes you have it varies the number in the if else)

Hope that helped

Last edited by Gudo (Feb. 8, 2018 08:03:55)

ParadoxScratching
Scratcher
100+ posts

Health bars

define health bar (run without screen refresh)
forever
clear
go to x: (0) y: (0)
pen down
go to x: (health) y: (0)
pen up
end

Did I help? If so, consider following me!

Forums not helping out your scripts? Want me to answer your questions in particular? Put your projects you have a question of in this studio! I would try my best to answer you. I care more about understanding the problem than knowing how to fix the problem.
https://scratch.mit.edu/studios/4636701/

Powered by DjangoBB

Standard | Mobile