Browse files

back to normal scoring

  • Loading branch information...
1 parent a15b07f commit c68218464fe11ec295c3466dd8872cd53bd7b7d6 @christianp committed Jun 26, 2012
Showing with 19 additions and 23 deletions.
  1. +2 −5 server.js
  2. +3 −3 static/css/thing.css
  3. +14 −14 static/index.html
  4. +0 −1 static/js/thing.js
View
7 server.js
@@ -131,8 +131,8 @@ Game.prototype = {
},
end: function() {
- //give the winning player 10 points
- this.currentPlayer.award(10);
+ //give the winning player a point
+ this.currentPlayer.award(1);
//tell the players
this.client.publish('/end-game',this.currentPlayer.name);
@@ -234,9 +234,6 @@ Game.prototype = {
this.client.publish('/played',{player: this.currentPlayer.name, word: word});
this.client.publish('/available-letters',this.availableLetters);
- //give the player a point for each letter
- this.currentPlayer.award(word.length);
-
//if there are unused letters in the word, it's the next player's turn
if(this.availableLetters.length)
this.nextTurn();
View
6 static/css/thing.css
@@ -15,14 +15,14 @@ hr {
padding: 0;
list-style-type: none;
}
-.player {
+#players .player {
padding: 0.2em 0.5em;
}
-.player.me {
+#players .player.me {
background-color: orange;
}
-.player.current {
+#players .player.current {
font-weight: bold;
}
View
28 static/index.html
@@ -43,7 +43,7 @@
<div id="container">
<form id="join" data-bind="if: !playing(), submit: join">
<h2>Join</h2>
- <label>Name: </label><input type="text" class="name"/>
+ <label>Name: </label><input type="text" class="name" autofocus/>
</form>
<div id="gameContainer" data-bind="if: playing">
@@ -56,6 +56,19 @@
</ul>
</div>
<hr/>
+ <div id="messages">
+ <h2>Messages</h2>
+ <ul class="list" data-bind="foreach: {
+ data: messages,
+ afterAdd: function(e){ console.log(e);$(e).hide().slideDown(150)}
+ }">
+ <li class="message" data-bind="class: kind">
+ <span class="player" data-bind="visible: player, text: player"></span>
+ <span class="content" data-bind="html: message"></span>
+ </li>
+ </ul>
+ </div>
+ <hr/>
<div id="game">
<h2>Game</h2>
<p>Available letters: <br/>
@@ -68,22 +81,9 @@
<li class="playedWord" data-bind="text: $data"></li>
</ol>
</p>
- </div>
- <hr/>
- <div id="messages">
- <h2>Messages</h2>
<form data-bind="submit: sendMessage">
<label>Chat:</label> <input type="text" class="message"/>
</form>
- <ul class="list" data-bind="foreach: {
- data: messages,
- afterAdd: function(e){ console.log(e);$(e).hide().slideDown(150)}
- }">
- <li class="message" data-bind="class: kind">
- <span class="player" data-bind="visible: player, text: player"></span>
- <span class="message" data-bind="html: message"></span>
- </li>
- </ul>
</div>
</div>
</div>
View
1 static/js/thing.js
@@ -194,5 +194,4 @@ $(function() {
var game = window.game = new Nulac();
ko.applyBindings(game);
- $('#join input').focus();
});

0 comments on commit c682184

Please sign in to comment.