Somebody who knows how please post here and help! I need help on making this game. It's like a match game. I want when two MATCHING sprites (in the way I want it to) are clicked, and they are the same, I want it to disappear. But I can't figure out the logic for it. Please post if you know how. Please help me!! So here is it again. I want two sprites, matching sprites, to hide if they are BOTH clicked. Ok, so somebody answer that for me please giving the explanation on how to do it. Also two more answers for questions. I want if two NOT MATCHING sprites are clicked, I want them to switch to the first costume. Also the timer block isn't working! Please tell me how to use the timer block. Thanks, please answer these questions!
Offline
Actually, this is a pretty interesting problem!
I would define a local variable (for this sprite only) for each sprite, maybe call it Type. And I would set each Type variable to the name of the type it is ("Apples", "Oranges", etc.) Then, I would set up a variable called "First_Click". I would set "First Clicked" to "empty" to start.
Every time a sprite is clicked I would look at First_Click. If it is empty, I would set it to the Type value for that sprite. If it is not empty, this must be the second click so I would compare it to the value of Type for the current sprite. If there is a match, give them a "Yay you got it", if there isn't a match, they get a "Bummer, not a match". Either way, I would then set First_Click back to empty to get ready for the next pair of comparisons.
Here's a demo project to show what I am talking about...I ended up coding it a little differently then described above. See the duck for the checking logic.
http://scratch.mit.edu/projects/Paddle2SeeFixIt/1867958
Last edited by Paddle2See (2011-06-17 21:40:43)
Offline
Ok thank you SO much, but I have just one question. Do you have the very first version of Scratch because I do.
Offline
Paddle2See wrote:
Actually, this is a pretty interesting problem!
I would define a local variable (for this sprite only) for each sprite, maybe call it Type. And I would set each Type variable to the name of the type it is ("Apples", "Oranges", etc.) Then, I would set up a variable called "First_Click". I would set "First Clicked" to "empty" to start.
Every time a sprite is clicked I would look at First_Click. If it is empty, I would set it to the Type value for that sprite. If it is not empty, this must be the second click so I would compare it to the value of Type for the current sprite. If there is a match, give them a "Yay you got it", if there isn't a match, they get a "Bummer, not a match". Either way, I would then set First_Click back to empty to get ready for the next pair of comparisons.
Here's a demo project to show what I am talking about...I ended up coding it a little differently then described above. See the duck for the checking logic.
http://scratch.mit.edu/projects/Paddle2SeeFixIt/1867958
I know this is being kind of critical but can you define "Local variable, first click, second click, etc. I have about 8 (4 matches).
Offline
Thescratch3 wrote:
Paddle2See wrote:
Actually, this is a pretty interesting problem!
I would define a local variable (for this sprite only) for each sprite, maybe call it Type. And I would set each Type variable to the name of the type it is ("Apples", "Oranges", etc.) Then, I would set up a variable called "First_Click". I would set "First Clicked" to "empty" to start.
Every time a sprite is clicked I would look at First_Click. If it is empty, I would set it to the Type value for that sprite. If it is not empty, this must be the second click so I would compare it to the value of Type for the current sprite. If there is a match, give them a "Yay you got it", if there isn't a match, they get a "Bummer, not a match". Either way, I would then set First_Click back to empty to get ready for the next pair of comparisons.
Here's a demo project to show what I am talking about...I ended up coding it a little differently then described above. See the duck for the checking logic.
http://scratch.mit.edu/projects/Paddle2SeeFixIt/1867958I know this is being kind of critical but can you define "Local variable, first click, second click, etc. I have about 8 (4 matches).
Ok, I exactly copied your scripts (like the variables and how to make them match and all) but it isn't working. If I click one correct pair, everything hides. If I click one wrong pair everything hides! I will upload the game, and can you download it on your Scratch and see what is the problem (You are like my online teacher!).
Offline
The name is Agent Smith Rescue if that information is necessary.
Offline
PLEASE HELP ANYBODY? check out my project and see the flaw please too (Agent Smith Rescue).
Offline