Tag Archives: mechanism

Scoreboard

Scoreboard is one of the most important feature in game, which show how good the player plays the game. What you have to prepare for creating a scoreboard is a global variable for score, text to display player’s score, and web storage object type.

Now, initialize score with initial value of “0”.
SS031

Every time you get point, make sure you add some value to score variable. System > Add to > (choose your variable and decide how much point you will get) > Done.
SS032 SS033

Keep the score up-to-date. I mean, every time player got point, you have to show it. System > Every thick (means every milliseconds, people will not recognize it) > Done. For the action, choose your score text > Set text > (type this without square brackets [“”&score], it means you directly tell player’s score without any words) > Done.
SS034

The result will be like this
SS035

SS036

There are 2 different text, one is saying the title “Score” and “High Score”, and the other is the value of player’s score.

Talking about high score. Not like usual score display, high score value usually still stored in game memory. See the difference here.
SS037

First you need to make a condition. In which condition, the score will be saved in game memory. Use web storage to save player’s score.
SS038

Go to add event, System > Compare variable > (choose your score variable, enter greater or equal for comparison, type the value like this [WebStorage.LocalValue(“hs”)]) > Done.
SS039
Also add the action to set local key of your high score [“hs”] to score. Add action > Web storage > (input the key and value) > Done.
SS040
Don’t forget to keep it update in real time, add “Every thick” event like what we do for score.