Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a Undertale health bar
- comlarsic
- Scratcher
4 posts
How to make a Undertale health bar
Hi i'm making a Undertale fan-game but i cant figure out how to make a health bar.
i tried doing this:
i created two sprites, one that hides the bar when its out of the health area and the bar itself.
these are the sprites for the bar:
but that doesn't work can anyone help?
i tried doing this:
i created two sprites, one that hides the bar when its out of the health area and the bar itself.
these are the sprites for the bar:
when green flag clicked
forever
set x to ((x position) + (health))
end
but that doesn't work can anyone help?
im not a good or bad man, im a mad man
Last edited by comlarsic (May 24, 2017 07:17:59)
i like cheese, and if you dont you'll go to hell before you die
- awesome-llama
- Scratcher
1000+ posts
How to make a Undertale health bar
Hi i'm making a Undertale fan-game but i cant figure out how to make a health bar.
i tried doing this:
i created two sprites, one that hides the bar when its out of the health area and the bar itself.
these are the sprites for the bar:when green flag clicked
forever
set x to ((x position) + (health))
end
but that doesn't work can anyone help?
The script says every loop, the sprite moves across it's x position PLUS the health. Every tick will move it across to the right. You may want to do something like:
set x to ((-50) + (health))where -50 is the x position of the sprite when there is 0 health in the variable.
- comlarsic
- Scratcher
4 posts
How to make a Undertale health bar
thx that seemed to work.
now i can continue with the project
now i can continue with the project
when green flag clicked
forever
imagine
program
share
end
i like cheese, and if you dont you'll go to hell before you die
- TheSillyClown
- Scratcher
27 posts
How to make a Undertale health bar
it is simple,you ony need 1 sprite,create the hp bar and convert to bitmap,then use the brush and set brush size to 1-5,thencreate a hp barr with it,then keep creating costumes with more red on it untill you get a costume that has full red,then make a hp variable and put
and keep doing that and you got your a HP bar
when green flag clicked
forever
if <<(HP) = []>99> then
switch costume to [ v]
end
end
and keep doing that and you got your a HP bar
- TheSillyClown
- Scratcher
27 posts
How to make a Undertale health bar
i meant
when green flag clicked
forever
if <(HP[] = 99> then
switch costume to [ 100]
end
end[
- TheSillyClown
- Scratcher
27 posts
How to make a Undertale health bar
as you can see i am new to this type of stuff,but just when flag clicked forever if HP is under 100 then swicth costume to 90's and yeah
- codeman1044
- Scratcher
1000+ posts
How to make a Undertale health bar
Please don't necropost. This topic is 2 years old.
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.
- TheSillyClown
- Scratcher
27 posts
How to make a Undertale health bar
Oh,i found a way
when green flag clicked
forever
set x to ((HP) + (X position - the max hp))
end
- TheSillyClown
- Scratcher
27 posts
How to make a Undertale health bar
when green flag clicked
forever
image
program
share
end
- TheSillyClown
- Scratcher
27 posts
How to make a Undertale health bar
define Scratch
[]
forever
image
program
share
end
- deck26
- Scratcher
1000+ posts
How to make a Undertale health bar
define Scratch
[]
forever
image
program
share
end[/quote]
Please stop blockspamming and necroposting.
- -Reshiram-
- Scratcher
100+ posts
How to make a Undertale health bar
Fixed quotesPlease stop blockspamming and necroposting.define Scratch
[]
forever
image
program
share
end
Last edited by -Reshiram- (Sept. 22, 2019 14:59:20)
I am now @SquirreIstar with an i, as in “I used to be -Reshiram-”
- hunochraties_
- Scratcher
2 posts
How to make a Undertale health bar
when green flag clicked
forever
define (Imagine program and share)
end
- SwanHelium
- Scratcher
3 posts
How to make a Undertale health bar
.
Last edited by SwanHelium (March 29, 2020 21:17:41)
- pvzsupersanicman
- Scratcher
47 posts
How to make a Undertale health bar
i cant make colors happen but just get a sprite and make a message of and
when green flag clicked
if <touching [ white] ?> then
broadcast [ oof]
end
sorry if this is wrong you dont get the blocks shown when you write
for the heatlh bar sprite make a full health costume and then keep making damaged heath bars then make a heath bar that is dead
when I receive [ oof]
next costume
plz know the game im using this on is a work in progress so i dont know how to die
- pvzsupersanicman
- Scratcher
47 posts
How to make a Undertale health bar
i will reply when i know more
Last edited by pvzsupersanicman (June 16, 2020 12:54:41)
- pvzsupersanicman
- Scratcher
47 posts
How to make a Undertale health bar
here is a link to my work in progress game it is deltarune but the heath bar still works for a undertale game https://scratch.mit.edu/projects/405166944/editor/
when green flag clicked
forever
image
program
share
end
Last edited by pvzsupersanicman (June 16, 2020 13:00:04)
- pvzsupersanicman
- Scratcher
47 posts
How to make a Undertale health bar
ok im back and i know how
make a death backdrop
than do this for your heath sprite
than use this
do this for all sprites
make a death backdrop
than do this for your heath sprite
when I receive [ death]
hide
than use this
if <[hp] = [0]> thensorry if this is wrong
broadcast [ death
end
do this for all sprites
when I receive [ death
hide
Last edited by pvzsupersanicman (June 16, 2020 13:52:23)
- Discussion Forums
- » Help with Scripts
- » How to make a Undertale health bar