Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Health Bar
- benfager
-
Scratcher
7 posts
Health Bar
Hello everyone
I am new to the scratch community, and I need some advice.
I know how to make a health bar, but is there a way that I could make a health bar appear below a moving sprite?
I am new to the scratch community, and I need some advice.
I know how to make a health bar, but is there a way that I could make a health bar appear below a moving sprite?
- lovescratch11
-
New Scratcher
41 posts
Health Bar
I'm sorry but I don't know if that's possible on scratch, you can't programme a variable

Soz,
LS11 xx

Soz,
LS11 xx
- lovescratch11
-
New Scratcher
41 posts
Health Bar
would theforever
go to [mouse pointer v]end
work?
No, you can't programme variables

- wkelly42
-
Teacher
100+ posts
Health Bar
Try the scripts in this project https://scratch.mit.edu/projects/10084700/
- benfager
-
Scratcher
7 posts
Health Bar
I know how to make the health bar itself, but I need to make it follow the player
- deck26
-
Scratcher
1000+ posts
Health Bar
I know how to make the health bar itself, but I need to make it follow the playerSo tell it to go to the player's coordinates, perhaps with an offset.
go to x: ([x position v] of [othersprite v]) y: (([y position v] of [othersprite v]) - (20))
- -Scratcher-
-
Scratcher
100+ posts
Health Bar
Hello everyoneFor the health bar:
I am new to the scratch community, and I need some advice.
I know how to make a health bar, but is there a way that I could make a health bar appear below a moving sprite?
foreveror for smooth motion:
go to x: ([x position v] of [Sprite v]) y: (([x position v] of [Sprite v]) - (20))
end
foreverHope that's what you want.
change x by ((0.2) * (([x position v] of [Sprite v]) - (x position)))
change y by ((0.2) * ((([y position v] of [Sprite v]) - (20)) - (y position)))
end
No, you can't programme variablesOf course you can, just go to the “Data tab”, make a variable and use the variable-blocks how you need them.![]()
![]()
![]()
- kabobbob
-
Scratcher
46 posts
Health Bar
You could go to these projects for health bars:
health bar
health bar
I will give you more if you need more!
health bar
health bar
I will give you more if you need more!
- lovescratch11
-
New Scratcher
41 posts
Health Bar
I know how to make the health bar itself, but I need to make it follow the player
Dear @benfager ,
You can't
You can't programme a variable
a variable is:
(Health)Sorry again:
LS11 xx
Last edited by lovescratch11 (June 17, 2015 14:50:21)
- wkelly42
-
Teacher
100+ posts
Health Bar
But you CAN program a bar based on what the variable is at any given time, put that in a sprite, and make it follow the player around. So yes, you CAN do what he wants to do.I know how to make the health bar itself, but I need to make it follow the player
Dear @benfager ,
You can't![]()
You can't programme a variable
a variable is:(Health)Sorry again:
LS11 xx
- shipofwar
-
Scratcher
4 posts
Health Bar
go to x: ([x position] of [Player]) y: (([y position] of [Player]) - (25))
- Discussion Forums
- » Help with Scripts
-
» Health Bar