Hello, my son and I are totally new to this and are doing a project. The game has a dog chasing a cat, you move the cat w/the arrow keys. We have that part figured out fine. Where it isn't working is that if the dog catches the cat the game is supposed to show a 3rd Game Over sprite and stop the first two sprites. We can't figure out how to make this happen. Here's what we did:
1. Created the 3rd sprite (game over). Have these blocks for it:
[blocks]
<when green flag clicked><hide><when I receive[ end]><show><stop all> [/blocks]
2. In the cat sprite blocks, created another stack block that is set up as:
[blocks]<when green flag clicked><if><touching[ sprite 2]><broadcast[end]and wait><else><wait until><touching[ sprite 2]>[/blocks]
This isn't working though. When the dog catches the cat, the game over sprite doesn't appear. In addition, I can continue to make the cat move with the arrow keys.
What are we doing wrong? Any help would be appreciated!
Offline
there is nothing wrong in the cat sprite but in the game over sprite it should be like this
[blocks]
<when green flag clicked>
<hide>
<when I receive[ end
<show>
<say[ game over.
<stop all>
[/blocks]
So you should
now have a working script.
Offline
It would be helpful if you could Share your game to the web...it's a lot easier to debug if you can run it yourself.
A couple of general things about the Stop All block...you have to be careful that you give your "game over" sprite time to display before you stop everything. I've made the mistake of having the Stop All block interfere with the final sequence of events. This is particularly true with online projects where the Stop All block seems to run very quickly.
Also, certain things are NOT stopped by the Stop All block. "When Key Pressed" hat blocks will still run, even after the Stop All block has run.
Offline
Hi there, thanks for the replies. We tried your suggestions but still can't get the Game Over sprite to appear. I posted the game at http://scratch.mit.edu/projects/JWinters755/437580. Any advice would be helpful, thanks.
Offline
the reason it's not working is because the block that broadcasts "end" is not a forever if block. since its an "if" block it does it for the moment not forever. everyone makes that mistake
Last edited by Ssbrawl700 (2009-03-02 10:01:24)
Offline
Ssbrawl700 wrote:
the reason it's not working is because the block that broadcasts "end" is not a forever if block. since its an "if" block it does it for the moment not forever. everyone makes that mistake
SSBrawl700 is right you need a forever loop. Another idea for the game is for the cat to move faster than the dog.
Offline
Ssbrawl700 and demosthenes, thanks a million, that did it! We will now work on enhancing the game to make it better. This is great!
Offline
JWinters755 wrote:
Hi there, thanks for the replies. We tried your suggestions but still can't get the Game Over sprite to appear. I posted the game at http://scratch.mit.edu/projects/JWinters755/437580. Any advice would be helpful, thanks.
your posted game is very interesting, I'm watching it now.
Offline
im afraid i cant help you, web blocks just cant compare!!!!
Offline