Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Score calculation not working
- 40F4
-
Scratcher
8 posts
Score calculation not working
I'm trying to make some kind of algorithm to calculate the maximum amount of points possible in my game. Every method I have tried results in something that runs quite slowly, or a score that is off by a few numbers. I have been trying to fix this for six hours and have had no luck.
For reference, the game is a rhythm game and the levels are determined by a list.
For reference, the game is a rhythm game and the levels are determined by a list.

- qwertycodechamp90411
-
Scratcher
100+ posts
Score calculation not working
How does the scoring system work?
- mstone326
-
Scratcher
1000+ posts
Score calculation not working
We are happy to help but need much more information on your scoring system.
- TechNerd64
-
Scratcher
500+ posts
Score calculation not working
Are you running it without screen refresh?
- 40F4
-
Scratcher
8 posts
Score calculation not working
Are you running it without screen refresh?Yes, I have tried running it with screen refresh and without
We are happy to help but need much more information on your scoring system.There is basically 2 kinds of notes that can spawn. If the note is alone (no notes were spawned directly before it) then correctly hitting the note gives a 10 point reward. However, if the note was spawned right after another one of the same type, it only rewards 1 point. There is also a combo system, every multiple of 35 notes in a row is rewarded with a higher multiplier (1x > x2 > x3…)
It seems that the system works fine up until the point where the multiplier is accounted for.
Note spawning system (kinda messy):

- mstone326
-
Scratcher
1000+ posts
Score calculation not working
Guessing, is the score or whatever updated by a broadcast? All clones will respond to a broadcast unless you control which one will respond
- 40F4
-
Scratcher
8 posts
Score calculation not working
Oh yeah, another scoring related script:

Here are the scripts for the algorithm stuff:





Here are the scripts for the algorithm stuff:




- 40F4
-
Scratcher
8 posts
Score calculation not working
Guessing, is the score or whatever updated by a broadcast? All clones will respond to a broadcast unless you control which one will respondNope, just a variable that changes when a clone dies
- mstone326
-
Scratcher
1000+ posts
Score calculation not working
Pretty much impossible to help with the scratchblocks. I wish I could offer better assistance but without seeing it is just guessing.
- 40F4
-
Scratcher
8 posts
Score calculation not working
Pretty much impossible to help with the scratchblocks. I wish I could offer better assistance but without seeing it is just guessing.What do you mean by that? I posted images of every script that relates to the scoring and algorithm stuff.
- mstone326
-
Scratcher
1000+ posts
Score calculation not working
Can you make a copy of your project and take out what shouldn't be seen yet and share that.
Even though we see the blocks for scoring, there could be a block within the project in another sprite accidentally causing issues.
Even though we see the blocks for scoring, there could be a block within the project in another sprite accidentally causing issues.
- 40F4
-
Scratcher
8 posts
Score calculation not working
Can you make a copy of your project and take out what shouldn't be seen yet and share that.Alright, will do.
Even though we see the blocks for scoring, there could be a block within the project in another sprite accidentally causing issues.
- 40F4
-
Scratcher
8 posts
Score calculation not working
Sorry for the incredibly messy code but here's the project
https://scratch.mit.edu/projects/871243551/
https://scratch.mit.edu/projects/871243551/
- 40F4
-
Scratcher
8 posts
Score calculation not working
Oh my gosh, I feel so stupid right now.
It was a rounding error in the game when calculating the combo variable.

Fixed it with this script, which just rounded to a single decimal:

Thanks for the help though!
It was a rounding error in the game when calculating the combo variable.

Fixed it with this script, which just rounded to a single decimal:

Thanks for the help though!
- Discussion Forums
- » Help with Scripts
-
» Score calculation not working



