Skip to content

Commit

Permalink
Score sending
Browse files Browse the repository at this point in the history
  • Loading branch information
jani-nykanen committed Oct 6, 2018
1 parent 7dfdaaa commit 4842d01
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion git.sh
Expand Up @@ -5,4 +5,4 @@ git add git.sh
git add README.md
git add index.html
git add style.css

git add server
Empty file added server/index.php
Empty file.
2 changes: 1 addition & 1 deletion src/game/gameover.js
Expand Up @@ -155,7 +155,7 @@ GameOver.prototype.update = function(vpad, game) {

// Send score
game.app.scenes.leaderboard.sendScore(this.name,
this.dist)
game.hud.dist);

// Go to the leaderboards scene
game.app.changeScene("leaderboard");
Expand Down
3 changes: 1 addition & 2 deletions src/leaderboard.js
Expand Up @@ -45,7 +45,7 @@ Leaderboard.prototype.sendRequest = function(params, cb) {
const URL = "https://game-leaderboards.000webhostapp.com/runningman/"

let url = URL + "?" + params;

this.fetching = true;

let xmlHttp = new XMLHttpRequest();
Expand All @@ -54,7 +54,6 @@ Leaderboard.prototype.sendRequest = function(params, cb) {

if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {

console.log(xmlHttp.responseText);
// Parse response
let s = xmlHttp.responseText.split('|');
let success = s[0] == "true";
Expand Down

0 comments on commit 4842d01

Please sign in to comment.