Discuss Scratch

DANARREN
Scratcher
25 posts

Health bars

So I’m making a battle cats like game (I have like 10) but I want to make hp bars.
It just can’t work and the hp bars go to the middle of the screen when an ally dies.
Also the hp bars don’t show the right hp values. How do you fix it?
iloveEVERTONtheyrule
Scratcher
68 posts

Health bars

For the problem of going to the middle of the screen, I think that if what you’re trying to do is make it disappear then you could broadcast a message, for example,
broadcast cat 1 dead
And then in the health bar sprite:
whenIreceive cat 1 dead hide


Also I have a good tip when it comes to health bars. Don’t use pen to do those 100 block codes for health bars, just make different health values as costumes. I have Health Bars as one of my shared projects, you can look at that if you want.

Last edited by iloveEVERTONtheyrule (Feb. 16, 2025 23:18:16)

DANARREN
Scratcher
25 posts

Health bars

I tried but idk how
102acrimea
Scratcher
100+ posts

Health bars

This is one of my projects that utilized a health bar script, refer to the “Health Bar Demo” sprite to see the code or the mess that is literally everything else to see it in context. Note that this project is rather old and may not work very well.

https://scratch.mit.edu/projects/752518551/editor/

Last edited by 102acrimea (Feb. 17, 2025 02:25:21)

SlimeKing145
Scratcher
31 posts

Health bars

Pretty sure there might be a tutorial on YouTube on how to make a health bar system with the pen extension, that might help
BlazingDan
Scratcher
100+ posts

Health bars

you can take the health bar from my bossfight project.

Powered by DjangoBB