Discuss Scratch

lovescratch2005
Scratcher
2 posts

How to make a game stop if score reaches a certain amount

Hi I am creating a game https://scratch.mit.edu/projects/105778586/#editor

I would like to stop the game if the player reaches a score of 20 and invite the player to go to another level. I do not know how to do this. I can not find any blocks that do that. Could you please help me. My idea is that the block should come after the existing block that changes the score by 1. I tried to use the equality operator and type score=20, but it did not work.

Thanks
RickCall12
Scratcher
100+ posts

How to make a game stop if score reaches a certain amount

when green flag clicked
forever

if <(Score) = [20 ]> then

broadcast [Next Level v]
end

end

You can also replace

broadcast [Next Level v]
to
stop [All v]
If you want all the scripts to stop.

Last edited by RickCall12 (April 17, 2016 17:26:16)

lovescratch2005
Scratcher
2 posts

How to make a game stop if score reaches a certain amount

Thank you RickCall12. I followed your advice and it worked in the sense that everything stops. Now I would like to change the screen from this level to next one. How do I do this? I am thinking, for example, to create a button that can be clicked and the screen changes or basically moves to a new project that has the script for the new level (basically the same, but different speed for the ball). Thanks again
BurnedCrystal
Scratcher
100+ posts

How to make a game stop if score reaches a certain amount

lovescratch2005 wrote:

Thank you RickCall12. I followed your advice and it worked in the sense that everything stops. Now I would like to change the screen from this level to next one. How do I do this? I am thinking, for example, to create a button that can be clicked and the screen changes or basically moves to a new project that has the script for the new level (basically the same, but different speed for the ball). Thanks again

We're not going to spoonfeed you

read the post again, it tells you how

Or, if it doesn't explain well enough somehow
when green flag clicked
repeat until <(score) = (20)>
broadcast [buttonshow v] and wait


end

when I receive [change level v] // so when you change levels...
do level changing stuff ::custom // as in change levels and stuff
repeat until <(score) = (20)>
broadcast [buttonshow v] and wait


end

then, in the other sprite

when I receive [buttonshow v]
show

when this sprite clicked
broadcast [change level v]
hide

Last edited by BurnedCrystal (April 17, 2016 22:49:11)

yana2316
New Scratcher
1 post

How to make a game stop if score reaches a certain amount

how do i get the timer to stop
customhacker
Scratcher
1000+ posts

How to make a game stop if score reaches a certain amount

The timer will never stop unless you do

forever

reset timer
end
customhacker
Scratcher
1000+ posts

How to make a game stop if score reaches a certain amount

Last edited by customhacker (June 21, 2016 19:47:15)

aliya03
New Scratcher
1 post

How to make a game stop if score reaches a certain amount

How do i end the whole game then restart it?
CRISTIAN_Gamboa
New Scratcher
1 post

How to make a game stop if score reaches a certain amount

OBAMA
deck26
Scratcher
1000+ posts

How to make a game stop if score reaches a certain amount

CRISTIAN_Gamboa wrote:

OBAMA
Please don't spam.
-ShadowOfTheFuture-
Scratcher
1000+ posts

How to make a game stop if score reaches a certain amount

CRISTIAN_Gamboa wrote:

OBAMA

Don't spam or necropost. This topic is from 2016.
Charles12310
Scratcher
1000+ posts

How to make a game stop if score reaches a certain amount

This topic still hasn't been closed even with necroposting. I will report this to be closed to prevent any more necroposts.

Powered by DjangoBB