ScratchData LogoScratchData
Back to gregatku's profile

Displaying a Score

GRgregatku•Created July 14, 2022
Displaying a Score
1
0
43 views
View on Scratch

Instructions

Displaying a Score - Click the Flag to start scoring. Let's face it, Displaying a Score in a game by showing the Score variable, is problematic. It's hard to choose where to put it, it's too small, and it's in an awful colour. This project shows you how to create a simple mini text engine to Display a Score, wherever you want, in whatever size or colour, and with or without a Shadow, although it is presently designed to place the Score in the top right corner of the Stage. Before starting the game simulation, you get the chance to experiment with the values for a few sliders to control how the score is displayed, namely colour, size and whether or not you want a shadow. The project pretends to be a game (it isn't really), with 1000 rounds where it is possible to score from 1-1000 points each round, just to show that the Show Score sprite works properly. However if you really want to pretend it is an actual game, then it actually saves the highest score ever achieved in a cloud variable, so you could try to beat that score, if you sit there playing the "non-game" long enough you will almost certainly eventually set the New Highest Score. Obviously, your total score by the end of the "non-game" should be somewhere around 500,000, but I somehow fluked getting 517,805 on my 4th try after sharing the project, and it seems you would have to be very lucky to beat that score. I did once when testing changes but since I was "Inside" the result didn't save to the cloud.

Description

Created by @gregatku for use in Coding Classes for Kids Unlimited. All code by me as a general purpose solution, but I will be getting my students to build a slightly simpler version. The Show Score sprite is the guts of the project, and you are welcome to backpack that sprite into you own projects, after setting the location, size, colour, and whether or not you want a shadow to suit your project. Of course you would then hide the Score variable, but it is retained in this project to prove that it all works properly. Important NOTE: The Show Score Sprite should NOT be used in any game where you can get a negative score in a Round. Otherwise once a new leading digit is displayed it won't be "rubbed-out" if the score is reduced sufficiently in subsequent rounds for that digit to be no longer required. It could be fixed by using "erase all" before the repeat loop, but if the project is using the Scratch Pen for purposes other than scoring, everything the Pen had drawn would get erased too!

Project Details

Project ID714091494
CreatedJuly 14, 2022
Last ModifiedJune 17, 2023
SharedJuly 14, 2022
Visibilityvisible
CommentsAllowed