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
Would this work?
[wait until <(win) = (10)>]
[switch to background [YOU WIN]]
Offline
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
Offline