Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Some things working some not
- jalil_hemphill
-
5 posts
Some things working some not
Heres the link to my game. (https://scratch.mit.edu/projects/327009051) it's basically a game where you try to find the house that the computer is hiding in and if you were wrong it's supposed to tell you Warm, Cold and Hot. But 3 houses I'm pretty sure don't work when I click on them. Not sure if i did something wrong and if anyone can help out great!
Thank you.
Thank you.
- deck26
-
1000+ posts
Some things working some not
This would be a good project to learn to use clones so you'd only need one sprite! Having multiple sprites and repeated scripts means a lot more work for debugging a problem like this.
It looks to me as if you're not covering all the options. For house 6, if the housepicked is 4 it doesn't say anything because you don't check for the difference being 2.
It looks to me as if you're not covering all the options. For house 6, if the housepicked is 4 it doesn't say anything because you don't check for the difference being 2.
- deck26
-
1000+ posts
Some things working some not
Also worth using the ‘abs’ function to reduce the scripts. If -1 and 1 give the same result then check the value of abs (houseclicked - housepicked).
You also don't need a separate wrong house broadcast for each house - just broadcast wronghouse and get the receiver to check is the sprite's housenumber matches the number clicked - only run the script if they match.
You also don't need a separate wrong house broadcast for each house - just broadcast wronghouse and get the receiver to check is the sprite's housenumber matches the number clicked - only run the script if they match.
- jalil_hemphill
-
5 posts
Some things working some not
Thank you. I will use the clones in a different project but I found out it was because the equation did not include 6 and 2(Like you said).
Any videos you recommend to learn how to use clones?
Any videos you recommend to learn how to use clones?
- deck26
-
1000+ posts
Some things working some not
Start with something simple with clones. Your project is actually a good one to try. Use a local (this sprite only) variable and give each clone its own value and you can work out its screen position from that - or you could use two local variables for the row and column. Then you could give a clone a random costume to vary the appearance of the game.
- Discussion Forums
- » Help with Scripts
-
» Some things working some not