-1

I cannot seem to find an answer anywhere else, so I am asking here hoping that someone would know.

With google leaderboard, I need it to sort by both high score and fastest completion time, is this possible?

example:

Player: Sally Score: 50 Time: 1:12:00

Player: Mike Score: 50 Time: 1:15:00

Player: Don Score: 50 Time: 2:22:00

I am currently do this using my own table and code with my website MySQL, but wanted to move to google play services leaderboard if it can do this.

Thank you.

off-topic: I think the confusion is that I was not asking how to code anything, I was asking if it was possible (if anyone knew of a way), using the google play services leaderboard, to have a leaderboard that sorts by not just a high score or fastest time, but both on the same leaderboard as in my example. I asked this in the google developer forum, and they suggested I ask here, go figure....

computingfreak
  • 4,939
  • 1
  • 34
  • 51
  • 1
    Do you have an example of the code you are using to try and sort this in leaderboard? Are you able to get it to sort by one or the other column? – RickH Jun 01 '14 at 02:44
  • I am just using a select statement from my MySQL table: $query = "SELECT * FROM $dbName . `scores` ORDER by `score` DESC, `thetime` ASC LIMIT $limit"; – user3695989 Jun 01 '14 at 02:59
  • off-topic? I gave an example of what I was asking, I am not sure what else I could explain. I am looking to know if anyone knew of a way to sort a Google play services leaderboard by both high score and fastest time for each player. From reading about leaderboards at Google's developer site I could not find that answer. – user3695989 Jun 01 '14 at 04:14
  • Please edit to include your current MySQL code, and *how* you're stuck translating that. (e.g. your best attempt). – Elliott Frisch Jun 01 '14 at 05:19
  • Well thank you, but I seem not to be able to get my issue understood here. It seems it is flagged as off-topic due to not understanding what I am asking. One person here seemed to understand the question to a point. Google leaderboard(s) allow for ONE parameter, a numerical type score OR a time stamp, OR currency. – user3695989 Jun 01 '14 at 16:43
  • They do not seem to allow a sort order to combine both a high-score and the time taken to achieve that score in a single leaderboard. I thought I may be missing something and that someone here may know what that was. I see that this is a CODE related site, and my question was more of a process question. If it is possible to make several leaderboards, combine the data from those into a single Google leaderboard, but I have done more research and it seems that it is not possible the way I want it displayed. – user3695989 Jun 01 '14 at 16:44
  • I guess I will not know asking this here, the powers here can just delete this, I will try another site just to be sure of myself before staying with my current in game code, that works well, but lacks the social interaction of google+.... – user3695989 Jun 01 '14 at 16:49

1 Answers1

0

you would have to make 2 leaderboards, one for time and one for score, after you do that you can query them each for highest, lowest, certain player, whatever, yes you can do that though, just a little different then your doing it with mysql, you would have to make 1 leaderboard for score and 1 for time

JRowan
  • 6,824
  • 8
  • 40
  • 59
  • Thank you, may I ask, doing it that way, I assume I have to keep my current in game leaderboard just populate with the stored google data? – user3695989 Jun 01 '14 at 02:26
  • what do you mean, you already have the game up and running you just would like to transfer to google? – JRowan Jun 01 '14 at 02:27
  • Yes, I have a game up and running, but I am working on a new version, it would be a whole new leaderboard, but wanted to move to the play game services if possible. When I said my current leaderboard, I was referring to the in game GUI leaderboard I currently display. – user3695989 Jun 01 '14 at 02:29
  • you would have to figure out how to transfer the scores and times from your leaderboard to google in an update, unless you start everything from new, if not and you want to keep your leaderboard and just transfer it to google you could probably make transition with one or two updates maybe query then save to google on first startup of app and use shared preferences, maybe keep track in your mysql then another update to just remove mysql tighten up your code, its definetly possible – JRowan Jun 01 '14 at 02:34