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

#1 2010-12-07 04:47:15

13ngel1
New Scratcher
Registered: 2010-09-12
Posts: 5

Problems (please help)

Hi Scratchers,

I need help with a problem. I'm designing a frogger clone, here's the link:

http://scratch.mit.edu/projects/13ngel1/1465020

I need the scripts to make it so when "win" is 10, then the background changes to the "YOU WIN" background.

Any tips?

Thanks.

13ngel1

Offline

 

#2 2010-12-07 04:53:25

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Problems (please help)

Would this work?

[wait until <(win) = (10)>]
[switch to background [YOU WIN]]


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2010-12-07 05:14:55

13ngel1
New Scratcher
Registered: 2010-09-12
Posts: 5

Re: Problems (please help)

Also, what's the script to make it so when win=10 is reached, all the superfluous sprites disappear?

Offline

 

#4 2010-12-07 05:36:30

maail
Scratcher
Registered: 2009-04-02
Posts: 1000+

Re: Problems (please help)

Read chapter 2, 4 and 5 of this. Read everything else if you want to understand it better! I think it will help in future one's too  wink


http://i.imgur.com/uH8sS.png

Offline

 

#5 2010-12-07 06:00:06

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Problems (please help)

13ngel1 wrote:

Also, what's the script to make it so when win=10 is reached, all the superfluous sprites disappear?

To hide/show sprites, you can use the blocks by the same name in the Looks section
[blocks]
<show>

<hide>
[/blocks]

To make it so that they hide when win=10, I would use a script like Jonathonpb showed on the stage (just because it's not related to any one sprite) and have it send a Broadcast message to all the sprites that need to hide:

Stage Script
[blocks]
<when green flag clicked>
<set{  Win  }to(  0
<broadcast[ Initialize ]and wait c>
<wait until> <( <{ Win  }> <=> 10 )>
<broadcast[ Game Won ]and wait c>
[/blocks]

Scripts on sprites that need to hide

[blocks]
<when I receive[ Initialize
<show>

<when I receive[ Game Won
<hide>
[/blocks]

Note that with broadcast messages, there are no built-in ones...you select New and type in whatever name you want.  So "Initialize" and "Game Won" were names I just picked because they made sense to me.  Broadcast messages are very useful - well worth your time learning.  Hope that helps  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer