Skip to content

Commit

Permalink
back to normal scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
christianp committed Jun 26, 2012
1 parent a15b07f commit c682184
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
7 changes: 2 additions & 5 deletions server.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions static/css/thing.css
Expand Up @@ -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;
}

Expand Down
28 changes: 14 additions & 14 deletions static/index.html
Expand Up @@ -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">
Expand All @@ -56,6 +56,19 @@ <h2>Players</h2>
</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/>
Expand All @@ -68,22 +81,9 @@ <h2>Game</h2>
<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>
Expand Down
1 change: 0 additions & 1 deletion static/js/thing.js
Expand Up @@ -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.