Post by jake on Jan 7, 2015 7:40:02 GMT
☁ Global Highscore Tutorial ☁
Time Of Tutorial - 5 minutes
Time Of Tutorial - 5 minutes
You must have knowledge of variables to continue.
First Step : Create the Score and HighScore Variables
You must create these 2 variables as they are required within the tutorial. First, make the score variable, then make a script that sets the score to 0 every time the green flag is pressed.
When Green Flag Pressed
set score to 0
set score to 0
So now that you have created the score variable, now create the Highscore variable but you must click on the Cloud Variable checkbox before saving the variable.
When you do that, the variables tab should look like this :
<make sure that they are check-boxed>
When you do that, the variables tab should look like this :
<make sure that they are check-boxed>
Second Step : Adding the Script
Now you must add the script that I have planned out. This script is common and used for beginners although there are other ways of doing the highscore script. This is the easiest way that I use in my projects. Copy this script into your project.
This is basically saying that if the score is bigger than the cloud highscore, then set the cloud highscore to current score. A pretty basic script. You can get the green block from operations and make the triangle is pointing right > or else the script will fail.
This is basically saying that if the score is bigger than the cloud highscore, then set the cloud highscore to current score. A pretty basic script. You can get the green block from operations and make the triangle is pointing right > or else the script will fail.
Final Step : Testing The Game
I made a quick game for this tutorial called EAT THE ORBS where you play as a sun and collect orbs by moving.
After you have finished all of the scripts, then press the green flag to test out the score function. Test out the example I made by clicking play the example.
Play The Example
Thanks for reading this tutorial. If you need help with your script then send me a message or comment and I will help out. Also comment if I have helped you.
Thanks for reading this tutorial. If you need help with your script then send me a message or comment and I will help out. Also comment if I have helped you.