Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do you make a healthbar?
- Underseeker5
- Scratcher
33 posts
how do you make a healthbar?
I'm currently developing a fps project where you are manning a cannon in a pirate ship and are shooting at a Giant Squid.
obviously, health is controlled via variable, but is there a way to make a full-on healthbar for a boss? i've tinkered with this a bit, but never got anything to work (nothing that looked good, at least).
Is there any way to implement a healthbar into a project?
obviously, health is controlled via variable, but is there a way to make a full-on healthbar for a boss? i've tinkered with this a bit, but never got anything to work (nothing that looked good, at least).
Is there any way to implement a healthbar into a project?
how do i signature
- codeman1044
- Scratcher
1000+ posts
how do you make a healthbar?
Check this out, though you'll need to mess around with it a bit.
This is my signature, which shows up every time I post and is automatic. To make a signature of your own, locate the “Change your signature” option in the bottom left of the Discussion Home.
I am nothing if not consistently inconsistent.
Snap! is a website that offers block coding like Scratch, but also offers the creation of your own blocks and writing JavaScript functions. The adventurous should consider checking it out!
Potentially useful tutorials and topic coverage
If you want to see a new tutorial added to this, feel free to leave a suggestion on my profile.
- iapere02
- Scratcher
100+ posts
how do you make a healthbar?
Its that easy, but only if you are talking about an UNDERTALE health bar. (The 92 and -1 is if its done in a sans fight)
Or something like Fight Start block.
when green flag clicked
hide variable [HP v]
set [HP v] to [92]
when I receive [Fight Start v]
show variable [HP v]
when I receive [Hit v]
change [HP v] by (-1)
Or something like Fight Start block.
Last edited by iapere02 (March 4, 2020 02:58:02)
hi
- RokCoder
- Scratcher
1000+ posts
how do you make a healthbar?
Here's Is there any way to implement a healthbar into a project?another example - it contains code for both pen and sprite methods.
- iapere02
- Scratcher
100+ posts
how do you make a healthbar?
Or variables.Here's Is there any way to implement a healthbar into a project?another example - it contains code for both pen and sprite methods.
hi
- ReznorZEZ
- Scratcher
100+ posts
how do you make a healthbar?
Its very simple! what I do is just this: I'm currently developing a fps project where you are manning a cannon in a pirate ship and are shooting at a Giant Squid.
obviously, health is controlled via variable, but is there a way to make a full-on healthbar for a boss? i've tinkered with this a bit, but never got anything to work (nothing that looked good, at least).
Is there any way to implement a healthbar into a project?
when green flag clickedThen just make a sprite with hearts or health indicators, then make one disappear when you get hit. When there is 0, you die. Make the ¨die¨ broadcast end the game and take you to the title screen (if there is one).
set [health v] to [Anything you want]
if <touching [enemy v] ?> then
change [health v] by ([-Whatever you want])
end
if <[Health v] = [0]> then
broadcast [Die v]
end
Last edited by ReznorZEZ (March 10, 2020 18:03:07)
-Reznor
- iapere02
- Scratcher
100+ posts
how do you make a healthbar?
i know this is old but wdym?Sorry? Or variables.
hi
- FoofJr
- Scratcher
100+ posts
how do you make a healthbar?
If it is old, don't reply.i know this is old but wdym?Sorry? Or variables.
Why hello there! Wonder why you are checking out my signature. While you're at it, why not check out my Gradient generator?
- Discussion Forums
- » Help with Scripts
- » how do you make a healthbar?