Showing Score on screen

I have a student who is creating a game. He would like the score to show on the screen. Is there a way to do this in Game Lab?

Make a variable to keep the score, then just draw it on the screen every frame.

Hello, @skschiltz.

Here’s a link to a previous post in the forum with an explanation on how to do it, but as @wutadam says, you would create a variable and then use the “text” block to write the score to the screen. If the text block is placed inside the draw loop, it will update every time the draw loop cycles.

Check back in if you you need any further assistance on it!

thanks,

Mike

First, make a variable that stores the player’s score (var Score = 0). Then after drawSprites(), put this code:
text("Score: " + Score), then your text coordinates.