Ok...
This will sound a bit complicated but...
I am not exactly sure what a variable is.
But! I made it so it counts how many things you have collected. (Not sure if that's what it's for but I did it)
I have about 4 sprites that need to be collected.
I think I am going to make more but for now there are only 4.
I want that when you collect all 4 sprites the background will change to a different scene.
I would appreciate if someone would plz reply soon!
Thanks!
-hellokitty-96
Last edited by hellokitty-96 (2008-10-22 02:41:18)
Offline
OK, a variable is like a holding-tank, as it always contains a number. Example:
Score's are usually variables. Use the "change "XXX" by 1" block to make the score variable bigger by 1. If you've used algebra in maths class, it's a bit like that.
Offline
[blocks]<when green flag clicked> <when green flag clicked>
<forever if> <forever if>
<touching[ sprite1] <{ XXX }> = 4
<change{ XXX }by( 1)> <switch to background[ XXX[/blocks]
Last edited by jasb (2008-10-22 13:53:51)
Offline
How to fix your problem.
make a variable called "Spritescollected".
Use the http://scratch.mit.edu/forums/viewtopic.php?pid=74103#req_message block to check if your player sprite has touched the "items". If it has, make that item http://scratch.mit.edu/forums/viewtopic.php?pid=74103#req_message, and increase "spritescollected by 1 (using the http://scratch.mit.edu/forums/viewtopic.php?pid=74103#req_message block).
then, in a seperate script, make a " IF "Spritescollected > 4 broadcast "Alldone" block. The broadcast block is like a pager, so you use the "when I recieve Alldone" block in the 'background' sprite, which is linked to a "change costume" block.
All of this is quite hard to explain, so if you don't understand, add another post. If you really don't understand, try looking at some projects on the scratch website, to see how it works.
Offline