[SOLVED] How do I make a gamescore?


Ok so Im trying to make a ingame score like this

ok so I looked this https://www.w3schools.com/graphics/game_score.asp but I want in to be based off how long you can survive and when you lose I want it to say restart heres the project link:https://playcanvas.com/editor/scene/773725

[SOLVED] Need Help With Score System

If you want to make the scoreboard from Flappy Bird, you probably ought to look at the Flappy Bird project:


Here is the code for the score.js script that sets the numbers on the score display:


Here’s the scoreboard entity in the hierarchy:

Notice how it has three child entities. One for each digit.

To set the score board, from any script, just call:

var score = 100;
this.app.fire('ui:score', score);

…assuming you set the score script name property to ‘score’.


I kinda need help setting it up lol


I just gave detailed instructions and a working example. What’s missing from my answer?


@Axulity_YT I can help with setting it up.


For flappy bird, when you pass a position, the score increases. Meaning in Galaxy ball, we should increase the score after a certain position.


Your explanation was very detailed and now I think I can create the Score System. Thank you!