This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-10 18:22:00

m00nbeam360
New Scratcher
Registered: 2012-07-10
Posts: 4

Health Bar and Screen Jumping?

Hi there,

I'm trying to make a health bar of some sort and I decided to use a variable. Is there a way to check "if health = 0" in any way?

Is there also a way to go through a level? I understand the idea of "broadcast" but is there a way to reset it to false?

Thanks!

Offline

 

#2 2012-07-10 18:29:27

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Health Bar and Screen Jumping?

if <(health) = (0)>
do stuff
end

m00nbeam360 wrote:

Is there also a way to go through a level? I understand the idea of "broadcast" but is there a way to reset it to false?

I dont understand what you mean by this.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-07-10 18:58:10

m00nbeam360
New Scratcher
Registered: 2012-07-10
Posts: 4

Re: Health Bar and Screen Jumping?

Wow, that's absolutely perfect! Thanks so much, now I know what the rounded pieces are for! I'm trying to figure out how to go to the next level but not go through multiples at the same time. Ideas?

Offline

 

#4 2012-07-10 19:06:41

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Health Bar and Screen Jumping?

Put these on the stage and make each "Level" as a seperate background. Make sure the level backgrounds are in the right order (background#1 = Level 1, background#2 = Level 2, etc)

when gf clicked
set [level v] to (1)
forever
switch to background (level)
when I receive [levelup v]
change [level v] by (1)
Then whenever you want to level-up, just use
broadcast [levelup v]


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#5 2012-07-10 19:22:47

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Health Bar and Screen Jumping?

Actually, you might want to use broadcast and wait so that the levels don't go up to much.


http://i47.tinypic.com/2iaa73k.png

Offline

 

Board footer