I have put this Scratch tutorial in a project itself, so you can simply watch it. Feel free to download the script template for score keeping (or as I call it, gameshow scoring) and reuse in your own projects!
If you prefer reading the tutorial, then continue on…
Tutorial: Game show scores on ScratchWe do this in only two steps:
1. Prepare variablesObviously, we need at least one variable for the scores, and an additional one to keep the total. In this tutorial, we will create three variables for the scores (i.e. score1, score2, score3) and another (i.e. totalScore) for the total score. In my tutorial project above, I populate score1, score2 and score3 with random numbers for illustration purposes. Normally, we would use them to keep more meaning scores. You may look at the the Fruit Basket project to see how I use them to keep count on different fruits.
2. Do the scoringThe main idea here is that we want to sum up score1, score2 and score3, and put the sum in totalScore. We could have just gone and set totalScore with the sums like this:
|Summing up scores (in a boring way)|
|Summing up score1 (in a more interesting way)|
|Wait 0.5 seconds before appending similar blocks to sum up score2|
|Appending similar blocks below to sum up score3|