 
 
   initGame: (x, y) ->
-    @state.set StateManager.Playing
+    @state = States.Playing
     @generateBoard x, y
 
 



  mouseUpHandler: (evt) =>
    return if game.state.is StateManager.GameOver
    if @countFlags() is @countMines()
      for [x, y] in game.neighborCoord @x, @y
        game.board.cases[game.positionFromCoord(x, y)].showTile()



  gameOver: (deadPosition) =>
    @state = States.GameOver
    @showMines(deadPosition)


  win: () ->
    @state =States.Win
    background = @board.board.rect 0, 0, 42*19, 42*13
    background.attr fill: 'rgba(255, 255, 255, 0.7)'
    winLbl = @board.board.text 42*19/2, 42*13/2, 'Win'
