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
What 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.Whenclicked
HideWait untilpoints=amount to winShowStop all
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:
I assume you have all the other scripts on the other sprites there.whenclicked
foreveriftouchingfish ▼?changepoints ▼by1iftouchingbonus fish ▼?changepoints ▼by10ifpoints=13broadcastYou Win! ▼stop all
whenclicked
switch to backgroundunderwater ▼
Questions?when I receiveYou Win! ▼switch to backgroundwin ▼
Last edited by SOScratch (2012-05-13 17:34:39)
Offline
Easy!
whenclicked
iftouchingorfish ▼touchingorfish2 ▼touchingfish3 ▼changescore ▼by1iftouchingbonus fish ▼changescore ▼by10iftouchingoctopus ▼setscore ▼to0ifscore=13sayYou win!for2secsstop all
Last edited by fetchydog567 (2012-05-14 06:27:24)
Offline
fetchydog567 wrote:
Easy!
whenclicked
ifscore>12sayYou win!for2secsstop allelseiftouchingorfish ▼?touchingorfish2 ▼?touchingfish3 ▼?changescore ▼by1iftouchingbonus fish ▼?changescore ▼by10iftouchingoctopus ▼?setscore ▼to0
Fixed and improved.
Last edited by jontmy00 (2012-05-15 09:13:30)
Offline
jontmy00 wrote:
fetchydog567 wrote:
Easy!
whenclicked
foreverifscore>12sayYou win!for2secsstop allelseiftouchingorfish ▼?touchingorfish2 ▼?touchingfish3 ▼?changescore ▼by1wait untilnottouchingorfish ▼?touchingorfish2 ▼?touchingfish3 ▼?iftouchingbonus fish ▼?changescore ▼by10wait untilnottouchingbonus fish ▼?iftouchingoctopus ▼?setscore ▼to0wait untilnottouchingoctupus ▼?Fixed and improved.
![]()
Improved the scripts.
Offline