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

#1 2012-01-18 14:31:56

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

games

hey i was just wondering how to make a bar at the top of a page that says how many lives you have left in a game? thanks!


CHEESE and pickles

Offline

 

#2 2012-01-18 18:03:32

creeper14927
New Scratcher
Registered: 2012-01-18
Posts: 15

Re: games

You use variables to make that.
There's probably somebody else who could explain it better. I'm not much of a game maker.

Offline

 

#3 2012-01-18 18:43:53

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

well thanks still!  smile  i really had no idea before!


CHEESE and pickles

Offline

 

#4 2012-02-01 17:13:07

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: games

what a coincidince...
auto healthbar

this may be a little fancier than what you wanted but should be pretty easy to follow and simplify


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#5 2012-02-05 15:56:05

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

yeah but it still really helped me  wink


CHEESE and pickles

Offline

 

#6 2012-02-05 20:13:49

K-Jam
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: games

just use a variable


http://images.inmagine.com/img/imagezoo/iz162/Iz162012.jpg COMPASS!!!

Offline

 

#7 2012-02-05 20:21:49

ProgramCAT
Scratcher
Registered: 2011-12-13
Posts: 500+

Re: games

You will have to create individual costumes for each health bar level and use a variable to switch between them.

when gf clicked
switch to costume [health10 v]
set [health v] to (10)
repeat until < < (health) = (0) > or < (health) < (0) > >
if <(health)=(10)>
switch to costume [health10 v]
end
if <(health)=(9)>
switch to costume [health9 v]
end
if <(health)=(8)>
switch to costume [health8 v]
end
if <(health)=(7)>
switch to costume [health7 v]
end
if <(health)=(6)>
switch to costume [health6 v]
end
if <(health)=(5)>
switch to costume [health5 v]
end
if <(health)=(4)>
switch to costume [health4 v]
end
if <(health)=(3)>
switch to costume [health3 v]
end
if <(health)=(2)>
switch to costume [health2 v]
end
if <(health)=(1)>
switch to costume [health1 v]
end
end

when gf clicked
do stuff //the game starts


Programming is an art...
Goodbye, Scratch. I am leaving because of the exams coming up at our school, though I'll check the forums once or twice a week.

Offline

 

#8 2012-02-06 11:36:33

Codebreaker
Scratcher
Registered: 2011-10-03
Posts: 100+

Re: games

I agree with programCAT. You can make ten costumes for the health sprite, it can kinda look like a battery bar, and then, you use the variables to determine what costume it should be on.


Latest project: Pixelation/Upcoming project(s): M.A.Z.E Runner

Offline

 

#9 2012-02-06 15:10:02

CatPerson
Scratcher
Registered: 2011-12-17
Posts: 1000+

Re: games

Make

(variables)


http://nyopoliticker.files.wordpress.com/2012/02/in_dog_we_trust_rusty.jpghttps://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSrxH2RAmte9adghivuoOhgklIlUcZUFuCAA0wFufFq-NWyZWg5http://www.buttonsonline.com/2012/obama/BO-rallysign-104.gif

Offline

 

#10 2012-02-07 16:42:37

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

K-Jam wrote:

just use a variable

ok


CHEESE and pickles

Offline

 

#11 2012-02-07 16:43:46

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

CatPerson wrote:

Make

(variables)

k


CHEESE and pickles

Offline

 

#12 2012-02-07 16:44:54

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

ProgramCAT wrote:

You will have to create individual costumes for each health bar level and use a variable to switch between them.

when gf clicked
switch to costume [health10 v]
set [health v] to (10)
repeat until < < (health) = (0) > or < (health) < (0) > >
if <(health)=(10)>
switch to costume [health10 v]
end
if <(health)=(9)>
switch to costume [health9 v]
end
if <(health)=(8)>
switch to costume [health8 v]
end
if <(health)=(7)>
switch to costume [health7 v]
end
if <(health)=(6)>
switch to costume [health6 v]
end
if <(health)=(5)>
switch to costume [health5 v]
end
if <(health)=(4)>
switch to costume [health4 v]
end
if <(health)=(3)>
switch to costume [health3 v]
end
if <(health)=(2)>
switch to costume [health2 v]
end
if <(health)=(1)>
switch to costume [health1 v]
end
end

when gf clicked
do stuff //the game starts

wowowwwwww that looks hard but sure


CHEESE and pickles

Offline

 

#13 2012-02-07 16:45:55

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

Codebreaker wrote:

I agree with programCAT. You can make ten costumes for the health sprite, it can kinda look like a battery bar, and then, you use the variables to determine what costume it should be on.

ok i don't know if i should use a varible, or the health sprite thing with different costumes


CHEESE and pickles

Offline

 

#14 2012-02-07 16:47:12

Victoria393
Scratcher
Registered: 2011-12-30
Posts: 100+

Re: games

this is weird this thread got like one reply before and now it's getting way more and i don't even know which to do. but thanks guys who replied  smile


CHEESE and pickles

Offline

 

Board footer