Discuss Scratch

Maryrosetwo
New Scratcher
1 post

How do I make an option to restart the game?

I am bit new and I will appreciate the help.
AbracaDoodle
Scratcher
10 posts

How do I make an option to restart the game?

Hey @Maryrosetwo!

So, to make an option to restart the game, it would probably be most practical make a custom block. Here's an example:

defineRestartGamecodeAll Code Here

Then, when you wanted the game to restart, it would go something like this:

whenIreceiveRestart GameRestartGame

A quick note, in the Scratch Editor the “Restart Game” custom block will be dark purple, not red. Anyway, hope I could help!

Sincerely,
Doodle
Aronix
Scratcher
77 posts

How do I make an option to restart the game?

Well this is a tricky topic, in order to "restart“ a game it depends on what is in use in the project at the time of ”death“. It also depends what you want to happen after death, you could just go back to the menu (If there is one) or you could have an entire death screen dedicated to the death of the player. But just so I don't end up writing 10 paragraphs including what to do in every scenario, we'll just say you have a start screen. And on this start screen you have fully functional Play button, How To Play button, and High Score button, all leading to separate menus containing the intended information/data. And this point, when you click the ”Play“ (on the stat screen) button it takes you into the game, and then you die/lose the game. In order to properly ”restart“ or ”reset" the project you must summon -all- the proper sprites/assets/variables in order to make it seem (at least to the project) as if it never happened. And everything's back to normal. This means resetting the necessary variables, showing the correct sprites, & deleting clones, ect. Whatever is needed to simulate a proper start screen without any of the game assets being active. This is important because having assets that aren't supposed to be active, active leads to unwanted bugs. And bugs aren't fun to fix, or have. If your still having trouble understanding, you can message me on my profile, i'm glad to help.
Mrkrabsfanboy
Scratcher
3 posts

How do I make an option to restart the game?

how do i get that red code block?
deck26
Scratcher
1000+ posts

How do I make an option to restart the game?

Mrkrabsfanboy wrote:

how do i get that red code block?
You don't. Red blocks appear in the forum because Scratchblocks doesn't understand them. Usually the person helping means ‘insert your own code here’.
--_Nova_--
Scratcher
1000+ posts

How do I make an option to restart the game?

If you broadcast something like init under a when gf clicked block and had the sprites get ready under that broadcast, you could use the broadcast as a forced gf click or use the broadcast to reset the sprites. You would have to replace every gf clicked block with when I recieve (except the gf script that broadcasts it).

Example:
whenclickedin one sprite onlybroadcastinitwhenireceiveinitas a replacement for all other when green flag clicked blocks. . .all scripts that would be under a when green flag clicked block in your project

If as Aronix said you had a start screen the play button would broadcast it when clicked and could be reset that way.

EDIT: oh wait this topic was necro'd

Last edited by --_Nova_-- (Sept. 4, 2018 23:27:43)

mikeonthemicrophone
Scratcher
1 post

How do I make an option to restart the game?

i don't know?
deck26
Scratcher
1000+ posts

How do I make an option to restart the game?

mikeonthemicrophone wrote:

i don't know?
Please don't necropost or post when you have nothing useful to add.
1063946student
Scratcher
5 posts

How do I make an option to restart the game?

I am making a platformer and I don´t know how to reset the level. Can you show me an actual script that I can use? Thank you! If you do so then you.
Nezon
Scratcher
1000+ posts

How do I make an option to restart the game?

1063946student wrote:

I am making a platformer and I don´t know how to reset the level. Can you show me an actual script that I can use? Thank you! If you do so then you.
Create your own topic, and please don't necropost.

an actual script is really easy.

whenclickedsetlevelto1whenclickedforeverswitchbackdroptolevel
1063946student
Scratcher
5 posts

How do I make an option to restart the game?

What I mean is when my player die, I want him to reset the level that it was on.
CoolCrafter1231
Scratcher
100+ posts

How do I make an option to restart the game?

i would suggest making a new topic to get more people to answer
utbotiand123
Scratcher
1 post

How do I make an option to restart the game?

Hello Everyone!

Im making a project and i need a bit help… My game is insperd by Flappybirds and i want to make a Restart/reset button when you die but can´t figure out how to do it. Here is a link to the project: https://scratch.mit.edu/projects/847400813/

All help Apriciated

/utbotiand
Paddle2See
Scratch Team
1000+ posts

How do I make an option to restart the game?

utbotiand123 wrote:

Hello Everyone!

Im making a project and i need a bit help… My game is insperd by Flappybirds and i want to make a Restart/reset button when you die but can´t figure out how to do it. Here is a link to the project: https://scratch.mit.edu/projects/847400813/

All help Apriciated

/utbotiand
It would be best if you made your own topic for this question so the conversation doesn't get too confused.

Powered by DjangoBB