How do I create an online leaderboard with anonymous login?

Get help using Construct 2

Post » Tue Jul 07, 2015 4:16 pm

I've done numerous searches on the Scirra forums for leaderboard and highscore implementation, but I'm still not quite seeing what I need.
Please forgive me if this has been covered before.

I'm just looking for a way for my online game to have a basic leaderboard. Top 10, top 20, whatever.
Problem is, for what I've seen, firebase, nugplay etc are all requiring the player to have to login or register.

I just need a way for my players to just type in their name before the game starts, play the game, after the game so them their ranking.
I've tried it with local storage, but it only seems to work on one computer. Say, I have an office full of co-workers playing my game on my server, I want them to be able to see their scores and everyones else's scores at the end of their games. All without having to register or login. Just type in their username.

Is this possible? Again, sorry if I overlooked something.
B
4
S
1
Posts: 8
Reputation: 743

Post » Tue Jul 07, 2015 6:07 pm

sure its possible, here are the steps i would do:

sql table

ID|plaeruniqueid|name|score|

phpapi
- requests scores
- submit scores

html5game
- generates a unique id (for example a big random value) and saves it in local storrage at the first start
- makes a ajax request to submit thi highscore (maybe automatically) api
- makes a ajaxrequest to get the highscore to the php api

I am sure there is an example somewhere. Look arround a little. also you can modify the login examples to your need and replace the login with the unique id.

this way is not very secure but it will suit your needs.
you could work with encryption to make it a little more secure (generation and transfer)

kind regards
B
19
S
7
G
1
Posts: 222
Reputation: 2,546

Post » Tue Jul 07, 2015 10:17 pm

Are there any third party services that can do that? I have hosting with Godaddy, but I'm not too versed with SQL or PHP. I'm sure I could get it working if I had instructions.
B
4
S
1
Posts: 8
Reputation: 743

Post » Tue Jul 07, 2015 11:34 pm

Idk but there is a very good tutorial on that topic: https://www.scirra.com/tutorials/346/on ... -php-mysql
B
19
S
7
G
1
Posts: 222
Reputation: 2,546


Return to How do I....?

Who is online

Users browsing this forum: Alvaro2, Yahoo [Bot] and 15 guests