Discuss Scratch

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?
JACsterandOlibob
Scratcher
1000+ posts

Health Bar

would the
forever

go to [mouse pointer v]end

work?
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
lovescratch11
New Scratcher
41 posts

Health Bar

JACsterandOlibob wrote:

would the
forever

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

benfager wrote:

I know how to make the health bar itself, but I need to make it follow the player
So 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

benfager wrote:

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?
For the health bar:
forever
go to x: ([x position v] of [Sprite v]) y: (([x position v] of [Sprite v]) - (20))
end
or for smooth motion:
forever
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
Hope that's what you want.

benfager wrote:

No, you can't programme variables
Of course you can, just go to the “Data tab”, make a variable and use the variable-blocks how you need them.
benfager
Scratcher
7 posts

Health Bar

thanks guys
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!
lovescratch11
New Scratcher
41 posts

Health Bar

benfager wrote:

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

lovescratch11 wrote:

benfager wrote:

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
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.
shipofwar
Scratcher
4 posts

Health Bar

go to x: ([x position] of [Player]) y: (([y position] of [Player]) - (25))
RL1123
Scratcher
1000+ posts

Health Bar

Please do not necropost

Powered by DjangoBB