Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Increasing Level Every Time Score Increases by 10
- GoonsNCSU
-
2 posts
Increasing Level Every Time Score Increases by 10
I accidentally necroposted on someone else's thread (I apologize, not great for my first post here!) but was wondering if someone could help with the following:
I'd like my variable ‘level’ to increase by 1 every time my variable ‘score’ increases by 10. I've tried if score = 10 then change level by 1….but I know I can't do this in a forever loop.
Any thoughts?
Thanks so much!
I'd like my variable ‘level’ to increase by 1 every time my variable ‘score’ increases by 10. I've tried if score = 10 then change level by 1….but I know I can't do this in a forever loop.
Any thoughts?
Thanks so much!
- deck26
-
1000+ posts
Increasing Level Every Time Score Increases by 10
If the score only changes in one place checking it as @asivi says is the best method.
If the score may change in multiple places you'll need a separate loop but avoid unnecessarily resetting a variable as @totalcode shows.
In the case of a separate check I'd do
If the score may change in multiple places you'll need a separate loop but avoid unnecessarily resetting a variable as @totalcode shows.
In the case of a separate check I'd do
You could use equals rather than greater than if you know score only ever changes by 1 but the above is generally safer.
- asivi
-
1000+ posts
Increasing Level Every Time Score Increases by 10
Well, in case you change score in multiple places as @deck26 commented you can have the script with the mod in just one place(no need of repeating it) and call it by bradcasting a message when it changes, so you can avoid race conditions that come up in case you change score very quickly and the project would be too busy(laggy perhaps).
- PCookie_
-
4 posts
Increasing Level Every Time Score Increases by 10
In my case, whenever the score increases by 10, I want my “coin” sprite to appear on the screen. I just don't know how to manage that.
- Morimop
-
1000+ posts
Increasing Level Every Time Score Increases by 10
Hello there! Sorry, but… You are necroposting. In my case, whenever the score increases by 10, I want my “coin” sprite to appear on the screen. I just don't know how to manage that.
If the topic has been inactive for a significant length of time, and the new post adds nothing to the topic, then the post can be considered a necropost. However, a post in a sticky or ITopic is not considered a necropost if it adds more useful information (these topics are kept at the top of the forum page anyway, so posting does not bump them). Necroposting on purpose is strongly discouraged, as it is unhelpful, clogging up the top of the forum with outdated and unneeded topics.
- PCookie_
-
4 posts
Increasing Level Every Time Score Increases by 10
this should work
what does requirement mean?
- codeman1044
-
1000+ posts
Increasing Level Every Time Score Increases by 10
Please don't necropost. If you need help with something, then please create your own topic.
- arkanSkibbidob
-
1 post
Increasing Level Every Time Score Increases by 10
I am tyring to make a project
this is it
https://scratch.mit.edu/projects/896950552/editor
Im trying to shrink the code pls help
this is it
https://scratch.mit.edu/projects/896950552/editor
Im trying to shrink the code pls help

- existentialcrisises
-
100+ posts
Increasing Level Every Time Score Increases by 10
As Morimop and codeman1044 said, please don't necropost. This topic is around 6 years old. If you want to ask a question about your project, please create a new topic.
- Discussion Forums
- » Help with Scripts
-
» Increasing Level Every Time Score Increases by 10