Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Record number of games played.

  • Loading branch information...
commit 1f1b8b3cd2f95ff12be9b5a8e685bc081726f4c2 1 parent 207e10c
@jimmycuadra authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.