 module.exports = class ShuffleGrid
   constructor: (@levels, @random, @$container) ->
     @random ?= new Random()
-    @movesTaken = 0
     @levelIndex = 0
     
     # Make the jQuery grid

  tryMoveTile: (tile) ->
    if tile.adjacentTo(@emptyTile)
      @trigger('tile-moved')
      @movesTaken++
      tile.swapWith @emptyTile, =>
        if @_isSolved()
          @levelComplete()

        @_slideTransition(nextLevel)
    
    else
      $img = $("<img style='height: 100%; width: 100%;' src='#{@level.image}'/>")
      $img.fadeIn 1000, =>
        @trigger('level-complete')
      @$grid.prepend($img)


  _zoomOutTransition: (nextLevel) ->
