Fix the score order

develop
Aaron Mueller 9 years ago
parent 9faee5f9d8
commit 5b4db62137
  1. 18
      dev/lib/game/main.js

@ -149,18 +149,22 @@ ig.module(
loadScores: function() {
ig.global.scores = undefined;
$.post('https://www.scoreoid.com/api/getScores', this.scoreoid, function(data) {
data = $.extend({}, {
order: 'desc',
order_by: 'score',
limit: 10
}, this.scoreoid);
$.post('https://www.scoreoid.com/api/getBestScores', data, function(data) {
ig.global.scores = data;
});
},
saveScore: function(username, score, cb) {
$.post('https://www.scoreoid.com/api/createScore', {
api_key: this.scoreoid.api_key,
game_id: this.scoreoid.game_id,
score: score,
username: username
}, cb(this));
data = $.extend({}, {
score: score,
username: username
}, this.scoreoid);
$.post('https://www.scoreoid.com/api/createScore', data, cb(this));
},
draw: function() {

Loading…
Cancel
Save