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

#1 2012-10-30 04:22:43

rainzy
New Scratcher
Registered: 2012-10-30
Posts: 2

Help!

I'm making as scratch game and it's an assignment for school. I have a variable called score and i want it to broadcast the next level but it won't work. I've tried If Score=20 broadcast level 2 and then i did the whole receive thing but i still can't get it to work. This probably makes no sense but yeah lol...

 
when space key clicked
if variable=20
broadcast level 2

Offline

 

#2 2012-10-30 04:29:28

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help!

rainzy wrote:

I'm making as scratch game and it's an assignment for school. I have a variable called score and i want it to broadcast the next level but it won't work. I've tried If Score=20 broadcast level 2 and then i did the whole receive thing but i still can't get it to work. This probably makes no sense but yeah lol...

 
when space key clicked
if variable=20
broadcast level 2

What is the space key's funtion? Start the game, end it ect. If you know what i mean


http://i49.tinypic.com/e84kdj.png

Offline

 

#3 2012-10-30 04:33:41

rainzy
New Scratcher
Registered: 2012-10-30
Posts: 2

Re: Help!

Willpower wrote:

rainzy wrote:

I'm making as scratch game and it's an assignment for school. I have a variable called score and i want it to broadcast the next level but it won't work. I've tried If Score=20 broadcast level 2 and then i did the whole receive thing but i still can't get it to work. This probably makes no sense but yeah lol...

 
when space key clicked
if variable=20
broadcast level 2

What is the space key's funtion? Start the game, end it ect. If you know what i mean

it starts level 1

Offline

 

#4 2012-10-30 04:39:56

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help!

That is what i wanted to hear! you have forgot a "forever" between the space key and the variable. You need it because otherwise when space is pressed it sees if score is equal to 20 and it's not and then it stops that script- you want it [b]forever[b/] asking if score equals 20 on level one

This is the new script

 
when [space v] key  pressed
forever
if <variable=[20]>
broadcast [level 2 v]

Last edited by Willpower (2012-10-30 04:44:49)


http://i49.tinypic.com/e84kdj.png

Offline

 

Board footer