Discuss Scratch

DuckoTurtle
New Scratcher
5 posts

How can I make my game restart every time I press flag?

How can I make my game restart every time I press flag?
ryandw
Scratcher
62 posts

How can I make my game restart every time I press flag?

Well you can set it up to where sprites go to a coordinate. Also hidden things you want show you need to script it to show. If you want things to hide you script it to hide like this:
when green flag clicked
show
when green flag clicked
show
go to x: (0) y: (0)
when green flag clicked
hide
Hopefully this helps!
Programming_Guru
Scratcher
84 posts

How can I make my game restart every time I press flag?

To restart a game when the start key is pressed you need to reset all the variables and positions.. Try to keep all of the reset in one start script that way it happens in the order that you want it.
Brad126735
Scratcher
73 posts

How can I make my game restart every time I press flag?

When the game stops, the whole game stops ALL processes. It does not reset the vars, so you'd need to do that with a block.
I will give an example. Say you had a var named ‘Banana’. And it slowly increased. If you wanted it to reset to, say, 112, you'd have to do this:
when green flag clicked
set [Banana] to [112]
Or, if you wanted to reset a character back to a defined position, say x=-112, y=78, you'd do this:
when green flag clicked
go to x: (-112) y: (78)
I hope I helped, Brad.
2108382
Scratcher
1 post

How can I make my game restart every time I press flag?

none of this works
kabobbob
Scratcher
46 posts

How can I make my game restart every time I press flag?

If you are using variables restart them by doing the following:
when green flag clicked
set [ variable] to [0 ]
helloandgoodbye9
Scratcher
1000+ posts

How can I make my game restart every time I press flag?

2108382 wrote:

none of this works
Can you link to the project?
MellerReal
Scratcher
88 posts

How can I make my game restart every time I press flag?

Here's an easy way..

when green flag clicked
go to x: (x) y: (y)
point in direction (90 v)

place that in every sprite.
footsocktoe
Scratcher
1000+ posts

How can I make my game restart every time I press flag?

DuckoTurtle wrote:

How can I make my game restart every time I press flag?

If anything in your game changes, if a sprite moves, if a backdrop switches, if ANYTHING changes, and then does not change back… then the game will not restart the same way.

THEREFORE, at the very beginning of the game, you must put everything where it is supposed to be. Everything that changes, that is. You don't have to worry about anything that does not change.

For example, if a sprite always “shows” then no need to worry about it. But if a sprite shows for a while and then “hides”, that means at the beginning of the game it needs the SHOW block in its script.
gabedg
Scratcher
1 post

How can I make my game restart every time I press flag?

doesent work
deck26
Scratcher
1000+ posts

How can I make my game restart every time I press flag?

gabedg wrote:

doesent work
Please create your own topic rather than necroposting. If you have a question about a project share it and describe the problem.
Nayori_
New Scratcher
1 post

How can I make my game restart every time I press flag?

None of this works tho?

Last edited by Nayori_ (Oct. 5, 2023 16:30:41)

Powered by DjangoBB