Add local highscore & online leaderboard to autorunner?

Get help using Construct 2

Post » Tue Apr 29, 2014 9:08 pm

Hello,

I'm making an autorunner game based on the Autorunner Template and wanted to include a local highscore and online leaderboard, but i don't know how to do it.

I have 3 layouts, Menu, Game (gameplay) & Game Over. I've managed to display the players score on the Game Over layout by setting text to "Your score " & round(TotalDistance) & " ". But i wanted to have the players highscore displayed on the Menu layout (even if they exit the game and go back in, that score will stay) and i want that score on the menu to change when it's been beaten, i don't know how to do this so i hope someone can help out.

With the Online leaderboard, i want to add a button on the Game Over screen that allows you to post your score online. I also wanted to create a button on the menu which takes you to the online leader which displays the top ten scores.

I hope i'm not asking too much and would appriciate any input.

Thanks
B
5
S
2
Posts: 116
Reputation: 867

Post » Tue Apr 29, 2014 10:03 pm

about local highscore you may use Webstorage

===when game over===
if webstorage key"highscore"exist
&
if webstorage value ("highscore")<now score
then
webstorage>set local value(key=highscore,value=score)

===to get highest score and display in menu===
set showscore.text = "The best : "&webstorage.get("highscore")&"!"

===how about online???===
There is many way to make it
but i guess you need to creat a php web server
or use other planform
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Wed Apr 30, 2014 1:52 pm

I've tried what you've said but it's not working for me, could you show an example with the AutoRunner Template so i can see where i'm going wrong?
B
5
S
2
Posts: 116
Reputation: 867

Post » Thu May 01, 2014 3:54 am

HEre you are
You do not have the required permissions to view the files attached to this post.
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Thu May 01, 2014 2:39 pm

It's a bit of a hard link to find at the top, but it's there... I jest of course. There is a 90% chance there is a tutorial for whatever you are looking for... providing you can find the right search words.

https://www.scirra.com/tutorials/top

"leaderboard"
https://www.scirra.com/tutorials/search?q=leaderboard
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Thu May 01, 2014 5:39 pm

@jayderyu I've searched for tutorials but although there are tutorials here on leaderboards, unfortunately I haven't come across one that suits my needs. There are a lot of tutorials so there could be the odd chance I've missed it but I have had a good look and not found one that I need, so I'm hoping people on here can help.

@fongka2 Thanks for the link but that hasn't worked for me. Could you perhaps do it based on the Autorunner Template as requested? My game is set up based on that template so that would help me out a lot as I can see where I'm going wrong.

Thanks
B
5
S
2
Posts: 116
Reputation: 867

Post » Fri May 02, 2014 11:17 am

SteveKane wrote:@jayderyu I've searched for tutorials but although there are tutorials here on leaderboards, unfortunately I haven't come across one that suits my needs. There are a lot of tutorials so there could be the odd chance I've missed it but I have had a good look and not found one that I need, so I'm hoping people on here can help.

@fongka2 Thanks for the link but that hasn't worked for me. Could you perhaps do it based on the Autorunner Template as requested? My game is set up based on that template so that would help me out a lot as I can see where I'm going wrong.

Thanks

that capx upload on this forum.............
im 100% i can download it
check your browser
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Fri May 02, 2014 1:32 pm

I can download the capx file you've uploaded, that's not the issue. I have downloaded the file you've uploaded but that doesn't solve my issue for me.

What I'm asking is if you can do a local high score for the Autorunner Template on Construct. That would help me as my game is based off that and I can see where I'm going wrong.
B
5
S
2
Posts: 116
Reputation: 867

Post » Mon May 05, 2014 2:19 pm

Can anyone else help me out with this please? It's a pretty important part of my game so would be grateful for help.

Thanks
B
5
S
2
Posts: 116
Reputation: 867


Return to How do I....?

Who is online

Users browsing this forum: Armench and 16 guests