       w = @sprite.width
       @_yOffset = h / 4
       @physics.setSize (w / 2), (h / 2), @_xOffset(), @_yOffset
+      @_justTurned = no # Because velocity won't be 0 when just turning.
+
+    _changeAnimation: (nameOrFrame, interrupt = yes) ->
+      return if interrupt is no and @animation?.isPlaying
+
+      if _.isNumber(nameOrFrame)
+        frame = nameOrFrame
+        return if @animations.frame is frame
+        @animations.frame = frame
+        @animation = null
+
+      else
+        name = nameOrFrame
+        return if @animation?.name is name
+        animation = @animations.play name
+        @animation = animation
+
+      @debug 'animation', nameOrFrame
+
+    _changeState: (state) ->
+      return if state is @state
+
+      @state = state
+      @debug 'state', state
 
     _run: (direction) ->
+      @nextAction = 'start' if @velocity.x is 0
+
       factor = 200
-      if @inMidAir()
+      if @isInMidAir()
         # TODO
-      else if @state isnt State.Running
-        @state = State.Running
-      @animations.play 'run' unless @animation?.isPlaying
+      else @nextState = 'running'
       @acceleration.x = factor * direction
 
-    _turn: (direction) -> # TODO: Replace with animation.
-      return if direction is @direction
-      shouldStop = @velocity.x isnt 0 and @nextAction isnt Action.Stop and @direction isnt direction
-      if shouldStop
-        @nextAction = Action.Stop
-        @animation = @animations.play 'stop' unless @inMidAir()
-      else if not @animation?.isPlaying
-        @nextAction = Action.Start
-        @animation = @animations.play 'start' unless @inMidAir()
+    _turn: (direction) ->
+      return if @isRunning(direction)
+
+      if @_justTurned
+        @nextAction = 'start'
+        @_justTurned = no
+      else if @velocity.x isnt 0 and @nextAction isnt 'stop'
+        @nextAction = 'stop'
+        @_justTurned = yes
+
       @direction = direction
       @sprite.scale.x = direction
       @physics.offset = new Phaser.Point @_xOffset(direction), @_yOffset
 
+    _updateAnimations: ->
+      unless @isInMidAir() or @nextAction is 'none'
+        @_changeAnimation @nextAction
+        return
+
+      switch @nextState
+        when 'running' then @_changeAnimation 'run', no
+        when 'still' then @_changeAnimation 17, no
+
     _xOffset: (direction = @direction) -> direction * 10
 
   Player


      @cursors = game.input.keyboard.createCursorKeys()

      @animation = null
      @state = State.Still
      @nextAction = Action.None

    inMidAir: -> no

    update: ->
      # Horizontal

      @nextAction = Action.None
      @acceleration.x = 0

      ###
      - Basically handle switching direction, and running or being still

        @_turn Direction.Right
        @_run Direction.Right

      else unless @isInMidAir()
        if @velocity.x isnt 0 then @nextAction = 'stop'
        else @nextState = 'still'

      @_updateAnimations()
      @_changeState @nextState

    _initAnimations: ->
      @animations.add 'run', [0..11], 24, on
