 ], (dat, Phaser, _, Background, defines, Helpers, Platforms, Player) ->
 
   'use strict'
+
+  MateLastFrame = 14
 
   class PlayState extends Phaser.State
 

        tileImageKey: 'balcony'
      , @game, @gui?.addOpenFolder 'platforms'

    _addPlayer: ->
      origin = @_createStartingPoint()
      @player = new Player { origin }, @game, @cursors, @gui?.addOpenFolder 'player'

    _createEndingPoint: ->
      _.last(@platforms.ledges).createMidpoint @platforms

    _createStartingPoint: ->
      new Phaser.Point defines.playerW, @world.height - defines.playerH

    _renderDebugDisplay: ->
      @resetDebugDisplayLayout()

      @background.layout()

    _addMate: ->
      {x, y} = @endingPoint
      x += 20
      y -= 10
      @mate = @add.sprite x, y, 'mate', 1
      @mate.anchor = new Phaser.Point 0.5, 0.5
      @mate.animations.add 'end', [1..MateLastFrame], 12

    _addMusic: ->
      @music = @add.audio 'bgm', 0, yes
