     @sprite.position.y = state.y
     if @sprite.animations.currentAnim.name != state.anim
       @sprite.animations.play(state.anim)
+      @sprite.body.drag.set(DRAG, DRAG)
     if state.skin && @skin != state.skin
       @skin = state.skin
       @sprite.loadTexture(@skin)

  controlledUpdate:->
    moves = @host.pollController()

    @sprite.body.acceleration.set(0, 0)
    @sprite.body.maxVelocity.set(100, 100)
    if (moves.left)
      @sprite.body.acceleration.x = -1000
    if (moves.right)
      @sprite.body.acceleration.x = 1000
    if (moves.up)
      @sprite.body.acceleration.y = -1000
    if (moves.down)
      @sprite.body.acceleration.y = 1000

    anim = "idle"
    if Math.abs(@sprite.body.velocity.x) > Math.abs(@sprite.body.velocity.y)

#= require Entity

class Avatar extends Entity
  ACCELERATION = 500
  MAX_SPEED = 200
  DRAG = 100

  constructor: ->
    super

    @movement =
      acceleration: new Phaser.Point
      max_velocity: new Phaser.Point

    @skin = @host.generator.pick(['nigel','bruce', 'julie', 'rachel'])
    @sprite = @host.spriteGroup.create(-100,-100, @skin)
    @sprite.animations.add("down", [0, 1, 2, 1], 10, true)
