       }
       frames: [0]
     currentFrameIndex: 0
+    debugAnimation: true
     lastUpdate: new Date().getTime()
     useTimer: false
     transform: Matrix.IDENTITY


  transition: (newState) ->
    return if newState == I.activeAnimation.name
    return unless I.activeAnimation.interruptible

    nextState = find(newState)



      if nextState
        I.activeAnimation = find(nextState) || I.activeAnimation
        sprite = I.spriteLookup[I.activeAnimation.frames.first()]

        I.width = sprite.width
        I.height = sprite.height

    I.currentFrameIndex = I.activeAnimation.frames[(frames.indexOf(I.currentFrameIndex) + 1) % frames.length]

  find = (name) ->
    result = null
    nameLower = name.toLowerCase()

    I.data.animations.each (animation) ->
      result = animation if animation.name.toLowerCase() == nameLower

    return result  

