This is my first time using Scratch. I followed a sample script for a game called 'Shark Attack' found at:
http://www.teach-ict.com/ks3/year7/game_generation/Scratch%20Guide%20-%20Shark%20Attack%20Game.pdf
The regular fish are worth one point, the bonus fish 10 points and the octopus resets your points to zero. I want to have the game end at 13 points - there are 3 fish plus the bonus fish - preferably with a 'You win!' message. How can I do this?
Thanks for your help!
Offline
If the game ends at a certain amount of points, I would suggest this, and you would make a sprite that says "You Win!" this script would go in this sprite
When gf clicked Hide Wait until <(points) = [amount to win]> Show Stop allWhat this does is hides the sprite when the green flg is clicked, waits for the score to reach the limit, then the "You Win!" sprite pops up and te game entirely ends. When you create the sprite on te left you'll see a "T". Click on it and type the text. Font size and stow is also changeable.
Last edited by turkey3 (2012-05-12 17:50:26)
Offline
Oh, this is easy!
Just follow these steps:
First you will need to make a variable called "Points."
Make the variable show to all sprites.
Make it and then input this script into the shark sprite:
when gf clicked forever if <touching [fish v]?> change [points v] by (1) end if <touching [bonus fish v]?> change [points v] by (10) end if <(points) = (13)> broadcast [You Win! v] stop all endI assume you have all the other scripts on the other sprites there.
when gf clicked switch to background [underwater v]
when I receive [You Win! v] switch to background [win v]Questions?
Last edited by SOScratch (2012-05-13 17:34:39)
Offline
Easy!
when gf clicked if <<touching [fish v]>or<<touching [fish2 v]>or<touching [fish3 v]>>> change [score v] by (1) end if <touching [bonus fish v]> change [score v] by (10) end if <touching [octopus v]> set [score v] to (0) end if <(score) = [13]> say [You win!] for (2) secs stop all end
Last edited by fetchydog567 (2012-05-14 06:27:24)
Offline
fetchydog567 wrote:
Easy!
when gf clicked if <(score) > [12]> say [You win!] for (2) secs stop all else if <<touching [fish v] ?>or<<touching [fish2 v] ?>or<touching [fish3 v] ?>>> change [score v] by (1) end if <touching [bonus fish v] ?> change [score v] by (10) end if <touching [octopus v] ?> set [score v] to (0) end end
Fixed and improved.
Last edited by jontmy00 (2012-05-15 09:13:30)
Offline
jontmy00 wrote:
fetchydog567 wrote:
Easy!
when gf clicked forever if <(score) > [12]> say [You win!] for (2) secs stop all else if <<touching [fish v] ?>or<<touching [fish2 v] ?>or<touching [fish3 v] ?>>> change [score v] by (1) wait until <not<<touching [fish v] ?>or<<touching [fish2 v] ?>or<touching [fish3 v] ?>>>> end if <touching [bonus fish v] ?> change [score v] by (10) wait until <not<touching [bonus fish v] ?>> end if <touching [octopus v] ?> set [score v] to (0) wait until <not<touching [octupus v]?>> end endFixed and improved.
Improved the scripts.
Offline