play.idevgames.co.uk
   254 GAMES
   523 MEMBERS
   20 TUTORIALS
   77 DEV LOGS
Forgot your password? Click here
Back

How to submit a score to a scoreboard in Construct 2


Posted: 2018-11-30 18:45:28 |    Posted by iDev |    idevgames.co.uk


2
Login to like

Submitting a score with construct 2 is incredibly easy. Using ajax you are able to send the information required to our servers to save a score. For security reasons you can not submit scores from your local computer or any other servers. Meaning that you will not receive a completed message when sending with ajax before uploading the game files to this site.

This simple example includes a text label, a text box and a button. When the button is pressed it sends the ajax request to the send URL. You will need to create your scoreboard in your edit game area which will provide you with the send URL (which is blank in the above example). The Ajax "Post to URL" action will need a tag which is used to see if the score has been completed (responds 0 on failure and 1 on success) and make sure you use the POST method.

Underlined is the scoreboardKey which is also found on your edit game page (different for each scoreboard). You will need to include a name which in this example is the text in the text box. The score is set as the variable that is set to 100. 

You could also pre fill the text box with the members username if the player is logged in by following this tutorial.

Also take a look at my construct 2 video tutorial:

Would you like to comment on this post? Create an account in less then 1 minute. Click here

Nobody has commented on this post yet.

Back to top

Privacy Policy Terms of Service