In Scratch Project, I notice some people have a project and when you win you get a password. Then you go to the next part and type in the password to keep playing. What kind of script is that?
Offline
First you would have the sprite broadcast something and then you'd use this: <when I receive[ <say[ ]for( )secs> and type in the password and the amount of secs the sprite says the password for. Then you'd do this: <when I receive[ then add the "ask _________" block found in Sensing, type in the question (ex. What's the Password?) then do: <when green flag clicked> <forever> <if> <else> <end> now get the answer block which is shaped like a slightly squashed hexagon (found in Sensing) and drag it into <( <=> )> then type in the correct password in the circle to the right of the block, now add it to the squashed hexagon in the <if><else><end> block and add <broadcast[ to the <if> part. Now put <say[ ]for( )secs> in the <else><end> part and your done! Just make the game continue when the game receives the last broadcast. Also fill in the blank parts for the actual programming blocks.
I'm sorry if this wasn't helpful.
Offline
PythonDreamer wrote:
First you would have the sprite broadcast something and then you'd use this: <when I receive[ <say[ ]for( )secs> and type in the password and the amount of secs the sprite says the password for. Then you'd do this: <when I receive[ then add the "ask _________" block found in Sensing, type in the question (ex. What's the Password?) then do: <when green flag clicked> <forever> <if> <else> <end> now get the answer block which is shaped like a slightly squashed hexagon (found in Sensing) and drag it into <( <=> )> then type in the correct password in the circle to the right of the block, now add it to the squashed hexagon in the <if><else><end> block and add <broadcast[ to the <if> part. Now put <say[ ]for( )secs> in the <else><end> part and your done! Just make the game continue when the game receives the last broadcast. Also fill in the blank parts for the actual programming blocks.
I'm sorry if this wasn't helpful.
Wait, I think I can add stuff inside the blocks. Can I? Also, maybe you're thinking of something else...
Offline
Have a list of all of the password to their corresponding level. To give the password when somebody has beat the level, recall the level's password from the list. When a password is entered look for it in the list and set the level to the location of the password in the list. You can look at the scripts in the game I made that uses this called Swirl World. I hope this helps.
Offline
or, nitezscratch is awesome like that and has a more creative way
it has it's stats set to a password. it's not very safe though, but it's fun.
Anyways, just make it so when the retrieve their password, you tell them a different one per level (the best ones are randomly generated with just one number in there or something) and then when the next game comes, you ask if they want to put in a password and if they put in the password for a certain level, you take them to the level.
Offline
There's many ways to do this, you need to know before hand that you want it to save and load like this though.
You just need something along the lines of this:
[blocks]
<when green flag clicked><ask password?>(couldn't find the ask block)<set{ Attempt }to( answer )<if ( Attempt <=> Password )> (Do whatever here) <end>
[/blocks]
First time using blocks and there's no preview on the quick editor, and seeming I can't edit what I post if anything's wrong then it's going to stay that way.
Offline
kayybee wrote:
muppetds wrote:
It is a good idea to remove the pass before you share
Uh... why?
the whole point is to use it in the project, not to get rid of it...
I think he meant a password that you have to have to VIEW the project.
@muppetds- We mean a password that is used inside the project so that people can't just pick any level.
Offline