Discuss Scratch

littlemisschobi
New Scratcher
4 posts

Making the Game Start Over

Hi guys! I know that's there's probably another thread like this, there are over a thousand pages. And I am not going to look through all of those. But anyways, my game has sprites that you are not supposed to touch. And I tried to make it so that every time the cursor touches that sprite, the game either starts over or ends. So I tried looking around and did the basic “death” code reappears everywhere. I can't remember it right now, but I follow the code perfectly and nothing happens. Does anyone have a different code that I can use that is guaranteed to work? Or can someone tell me what I might be missing? Please? Thank you!

littlebunny06
Scratcher
100+ posts

Making the Game Start Over

Wait… Can you share the project so I can adapt some(a) scripts(s) in a desired fashion?
cc_scratch_cc
Teacher
24 posts

Making the Game Start Over

iftouching?thenstop all
littlebunny06
Scratcher
100+ posts

Making the Game Start Over

cc_scratch_cc wrote:

iftouching?thenstop all
That will stop the project, not make a game start over…
Legolover2018
Scratcher
100+ posts

Making the Game Start Over

littlebunny06 wrote:

cc_scratch_cc wrote:

iftouching?thenstop all
That will stop the project, not make a game start over…

Yes, instead, show a game over screen and then… is there a main menu at the beginning? You'll need one.
Make it so when you start it shows you the menu and resets the race. When you click the start button it
needs to broadcast a message to all the sprites in the race view to show (as at the start view they are hidden) then make
the cars go to the starting location and let the race begin!

Just hide the cars on the menu screen/start, then when you press the start button, hide the main menu and show the cars.
When it stops just create a broadcast after game over to bring it back to the main menu, make sure when this happens the cars hide
and the menu shows. Make the start button and the main menu screen separate sprites. This means you can code the button to start the game.
The menu needs only a bit of code (the on start, show and the when broadcast received show, etc) but you can animate it if you like.

Remove that stop all block.
Legolover2018
Scratcher
100+ posts

Making the Game Start Over

Wait, I thought it was a race project lol, sorry!
ScratchDiogoh
Scratcher
1000+ posts

Making the Game Start Over

You must do in any place:
whenclickedbroadcastStart!
After doing this you should remove all the blocks:
whenclicked
Per:
whenIreceiveStart!
Then Make a Script Like this:
whenIreceiveStart!foreverif...thenbroadcastStart!
littlemisschobi
New Scratcher
4 posts

Making the Game Start Over

littlebunny06 wrote:

Wait… Can you share the project so I can adapt some(a) scripts(s) in a desired fashion?
I'm sorry, I don't want anyone editing my project because it is an assignment for a coding course that I am taking.
littlemisschobi
New Scratcher
4 posts

Making the Game Start Over

Thank you guys so much! I will try all of your methods!

Last edited by littlemisschobi (July 7, 2018 09:07:28)

Powered by DjangoBB