Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some decent messages for the endgame state.

  • Loading branch information...
commit 0622a6b2c9da89b2287826b88e78ebac91ebe892 1 parent b6ff3d2
@apparentlymart authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 js/matchem.js
View
9 js/matchem.js
@@ -105,8 +105,13 @@
slideMessageUp(message, complete);
},
endOfGame: function (winners) {
- // TODO: Real message for this state
- slideMessageLeft("End of game! Winners: " + winners);
+ if (winners.length == 1) {
+ var playerName = game.players[winners[0]].name;
+ slideMessageLeft(playerName + " wins!");
+ }
+ else {
+ slideMessageLeft("It's a draw!");
+ }
},
};
players = [];
Please sign in to comment.
Something went wrong with that request. Please try again.