Discuss Scratch

Rickyickerson
Scratcher
10 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)





↑↑ Click any of the images for an awesome project! ↑↑





If you see this, cubeupload is down, so you cannot see these images. :(
http://i.cubeupload.com/KJqv3O.png
http://i.cubeupload.com/GTIw5Z.png









My 500th post: https://scratch.mit.edu/discuss/topic/189237/
My 1000th post: https://scratch.mit.edu/discuss/topic/216809/
My 1500th post: https://scratch.mit.edu/discuss/topic/234381/?page=1#post-2388018

200,000 topics!


https://scratch.mit.edu/projects/70921878/
http://i.cubeupload.com/TRkY0u.png





—— end of signature ——
This part is me not bothering to store everything on my computer, and instead here.


“awesome-llama's-topic-identifierSCRATCH”
YmFja3VwLXNpZ2d5LWlk Google this to see some of my posts.
https://scratch.mit.edu/discuss/topic/233605/?page=1#post-2383020

Gudo
Scratcher
27 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!

Powered by DjangoBB

Standard | Mobile