Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » health bar using variable
- uobihara12
-
Scratcher
26 posts
health bar using variable
i need to make a health and XP bar for my game scratchemon
- asivi
-
Scratcher
1000+ posts
health bar using variable
i need to make a health and XP bar for my game scratchemonIt depends about how the project is, you can use the pen tool or a set of costumes.
- The-Nick-of-Time
-
Scratcher
100+ posts
health bar using variable
For this I recommend a costume for each stage of the health bar. Then make a ‘Health’ variable. After setting this up, you must give the health bar sprite a script along the lines of "Forever-If variable ‘health’=1, switch costume to 1. If variable ‘health’=2, switch costume to 2. do this for as many stages as you need. I hope this helped! good luck with Scratchemon!
forever
if <(Health) = [1]> then
switch costume to [1 health]
end
if <(Health) = [2]> then
switch costume to [2 health]
end
if <(Health) = [3]> then
switch costume to [3 health]
end
if <(Health) = [4]> then
switch costume to [4 health]
end
end
Last edited by The-Nick-of-Time (Aug. 23, 2016 22:55:58)
- amylaser
-
Scratcher
500+ posts
health bar using variable
For this I recommend a costume for each stage of the health bar. Then make a ‘Health’ variable. After setting this up, you must give the health bar sprite a script along the lines of "Forever-If variable ‘health’=1, switch costume to 1. If variable ‘health’=2, switch costume to 2. do this for as many stages as you need. I hope this helped! good luck with Scratchemon!forever
if <(Health) = [1]> then
switch costume to [1 health]
end
if <(Health) = [2]> then
switch costume to [2 health]
end
if <(Health) = [3]> then
switch costume to [3 health]
end
if <(Health) = [4]> then
switch costume to [4 health]
end
end
Instead of that, you could also do this:
forever
switch costume to (health)
end
However, this assumes that your costume numbers correspond to the health – so for example, costume 1 would be an image of the health bar at 1 HP, and costume 2 would be an image of the health bar at 2 HP, and so on.
Then you could do the same thing for the XP bar in a separate sprite.
Last edited by amylaser (Aug. 24, 2016 00:42:13)
- FlubbaFish
-
Scratcher
62 posts
health bar using variable
Fill the bar in red and use the stamp feature.
- uobihara12
-
Scratcher
26 posts
health bar using variable
For this I recommend a costume for each stage of the health bar. Then make a ‘Health’ variable. After setting this up, you must give the health bar sprite a script along the lines of "Forever-If variable ‘health’=1, switch costume to 1. If variable ‘health’=2, switch costume to 2. do this for as many stages as you need. I hope this helped! good luck with Scratchemon!
Thx it almost done already just moves,types and other Scratchemon.
- onehow
-
New Scratcher
1 post
health bar using variable
Can you explain more?
_____________________________________-
پایان نامه | مشاوره پایان نامه مدیریت
_____________________________________-
پایان نامه | مشاوره پایان نامه مدیریت
- uobihara12
-
Scratcher
26 posts
health bar using variable
Can you explain more?don't worry about it
_____________________________________-
پایان نامه | مشاوره پایان نامه مدیریت
- LP_Play
-
Scratcher
1000+ posts
health bar using variable
I made a progress bar system at
https://scratch.mit.edu/projects/119030710/
https://scratch.mit.edu/projects/119030710/
- uobihara12
-
Scratcher
26 posts
health bar using variable
I made a progress bar system atthx it
https://scratch.mit.edu/projects/119030710/
' finished here it is. https://scratch.mit.edu/projects/118963049/ .thx!!!

- The-Nick-of-Time
-
Scratcher
100+ posts
health bar using variable
Don't quote me on that.Whoops! xD
NOOOOOOO!!
- Nice_Flame
-
Scratcher
100+ posts
health bar using variable
Don't quote me on that.Whoops! xD
NOOOOOOO!!
Stop messing around! If you guys wanna chat go to a different section of the forums!
- ydt_antony
-
Scratcher
16 posts
health bar using variable
guys i makde a multiplayer game and i want to set health bar visible ony to the specified player (all players see my health bar) help me please!https://scratch.mit.edu/projects/416644277/
- cs2925723
-
Scratcher
100+ posts
health bar using variable
guys i makde a multiplayer game and i want to set health bar visible ony to the specified player (all players see my health bar) help me please!https://scratch.mit.edu/projects/416644277/Please do not post on old topics/Nercopost. People will be able to help you more if you create a new topic.
- Discussion Forums
- » Help with Scripts
-
» health bar using variable











