Skip to content
Browse files

Record number of games played.

  • Loading branch information...
1 parent 207e10c commit 1f1b8b3cd2f95ff12be9b5a8e685bc081726f4c2 @jimmycuadra committed
Showing with 3 additions and 2 deletions.
  1. +2 −1 source/javascripts/models/store.js.coffee
  2. +1 −1 source/javascripts/templates/stats.hamlc
View
3 source/javascripts/models/store.js.coffee
@@ -8,6 +8,7 @@ class ph.Store extends Backbone.Model
initialize: ->
@set(currentTime: 0)
+ @set(gamesPlayed: @get("gamesPlayed") + 1)
@on("change", @persist, this)
@timer = new Timer
@timer.every(1, @addTick)
@@ -25,7 +26,7 @@ class ph.Store extends Backbone.Model
resetStats: ->
if confirm "Are you sure you want to permanently reset your stats?"
@timer.reset()
- @set(highScore: 0, gamesPlayed: 0, currentTime: 0, totalTime: 0)
+ @set(highScore: 0, gamesPlayed: 1, currentTime: 0, totalTime: 0)
@timer.start()
addTick: =>
View
2 source/javascripts/templates/stats.hamlc
@@ -24,4 +24,4 @@
%td 0
%td 0
%td= @formatTime(@totalTime)
- %td 0
+ %td= @gamesPlayed

0 comments on commit 1f1b8b3

Please sign in to comment.
Something went wrong with that request. Please try again.