Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to End the Game After Reaching a Certain Score
- meridasbow
- New Scratcher
2 posts
How to End the Game After Reaching a Certain Score
I'm using Scratch to make a game for class, where you get points for clicking certain sprites and lose points for clicking other sprites. I want to have the game end when the player gets 10 points, but I don't know how.
On a side note, how do I resize a sprite to make it smaller?
On a side note, how do I resize a sprite to make it smaller?
- crisostimo
- Scratcher
500+ posts
How to End the Game After Reaching a Certain Score
Resize a sprite with:
Some people will tell you to use a forever block to answer your first question. I personally prefer to make a broadcast immediately following any time where you change the score then run some code to check the score:
set size to (50) %
Some people will tell you to use a forever block to answer your first question. I personally prefer to make a broadcast immediately following any time where you change the score then run some code to check the score:
change (score) by (1)
broadcast [Check Win v]
when I receive [Check Win v]
if ((score) > (9))
do the right thing to end the game
- meridasbow
- New Scratcher
2 posts
How to End the Game After Reaching a Certain Score
Thank you so much!! I'll credit you for your help when I finish the game. Resize a sprite with:set size to (50) %
Some people will tell you to use a forever block to answer your first question. I personally prefer to make a broadcast immediately following any time where you change the score then run some code to check the score:change (score) by (1)
broadcast [Check Win v]
when I receive [Check Win v]
if ((score) > (9))
do the right thing to end the game
- MysticPuma1886
- Scratcher
3 posts
How to End the Game After Reaching a Certain Score
So you need to use the end script for this, it would look like this.
if <Score=Winning Score> then
stop [all v]
end
- Thm14
- Scratcher
1 post
How to End the Game After Reaching a Certain Score
But how do you get those red blocks then
- FiveCubed
- Scratcher
100+ posts
How to End the Game After Reaching a Certain Score
But how do you get those red blocks then
Haha they're just a scratchblocks bug. It should look like this:
if <(score) = (winning score)> then
stop [all v]
end
- PokemonBFFS16
- Scratcher
13 posts
How to End the Game After Reaching a Certain Score
I'm using Scratch to make a game for class, where you get points for clicking certain sprites and lose points for clicking other sprites. I want to have the game end when the player gets 10 points, but I don't know how.
On a side note, how do I resize a sprite to make it smaller?
Well you will need to make a varible. And when you get points put change points bby 1. The script is like this.
forever
if <[(points)] = [10]> then
stop [all v]
end
end
and to resize it do this but inside put your size
set size to () %
change size by ()
- furrypig
- Scratcher
100+ posts
How to End the Game After Reaching a Certain Score
when green flag clicked
set [score v] to (0)
wait until <<(score) = (10)> or <(Score) > (10)>>
broadcast [game done v] //add a "when I recieve [game done]" in other sprites and below it add scripts for what the sprite should do at the end.
- really_dani1
- New Scratcher
2 posts
How to End the Game After Reaching a Certain Score
where do you put them tho
- TomasDev
- Scratcher
100+ posts
How to End the Game After Reaching a Certain Score
More easy this… I'm using Scratch to make a game for class, where you get points for clicking certain sprites and lose points for clicking other sprites. I want to have the game end when the player gets 10 points, but I don't know how.
On a side note, how do I resize a sprite to make it smaller?
Here's the step if you want only a background saying You win!
when green flag clicked
forever
if <(score) = [10]> then
play sound [youwinsound v]
switch backdrop to [youwinbackdrop v]
stop [all v]
end
end
And for a message
when green flag clicked
forever
if <(score) = [10]> then
say [You win!] for (2) secs
stop [all v]
end
end
- deck26
- Scratcher
1000+ posts
How to End the Game After Reaching a Certain Score
Can we please stop necroposting on this topic. The red blocks don't exist - in Scratchblock mode the forum shows things it doesn't understand as if they are red blocks. They're often used in the forum to indicate a place where you add your own code if necessary.
Start your own topic if you have a question - you can still refer to this topic if required.
Start your own topic if you have a question - you can still refer to this topic if required.
- DJSvideogamer229
- Scratcher
85 posts
How to End the Game After Reaching a Certain Score
That's a really easy question to answer:
when I receive [ Ending]
if <(score) = (amount of points needed)> then
broadcast [good ending! ]
Last edited by DJSvideogamer229 (June 5, 2018 21:05:56)
- badatprogrammingibe
- Scratcher
500+ posts
How to End the Game After Reaching a Certain Score
That would make this discussion spamming, because in its essence it's irrelevant to the topic of this topic.Anything irrelevant in a forum post is considered spamming.It's not really spamming if it's just a single sentence, and a single post.No, you're spamming. IchySpiderPiG24 RULES
- deck26
- Scratcher
1000+ posts
How to End the Game After Reaching a Certain Score
Correct but would you rather I'd ignored you? We can stop it now.That would make this discussion spamming, because in its essence it's irrelevant to the topic of this topic.Anything irrelevant in a forum post is considered spamming.It's not really spamming if it's just a single sentence, and a single post.No, you're spamming. IchySpiderPiG24 RULES
- Discussion Forums
- » Help with Scripts
- » How to End the Game After Reaching a Certain Score