     defaultOptions =
       direction: Math.random()*Math.PI*2
       position: randomizePosition()
-      velocity: [0, 0] #[Math.random(), Math.random()]
+      velocity: [0, 0]
       score: 0
       size: 0.025
       accelerating: false

  wasHit: ->
    @health -= 1

  updateStatus: (data)->
    @position = data.position
    @velocity = data.velocity
    @direction = data.direction

  runFrame: (timeDiff)->
    if (@health == 0)
      timeSinceDeath += timeDiff
      if (timeSinceDeath > @respawnTime)
        timeSinceDeath = 0
        @health = @initialHealth
        @position = randomizePosition()
        @velocity = [0, 0]

    options = _.merge(defaultOptions, options)

    @id = lastShipId++
    @direction = options.direction
    @position = options.position
    @velocity = options.velocity
    @score = options.score
    @size = options.size
    @accelerating = options.accelerating
    @acceleration = options.acceleration
    @timeSinceDeath = options.timeSinceDeath
    @health = options.initialHealth
    @initialHealth = options.initialHealth
    @respawnTime = options.respawnTime

  serialize: ->
    id: @id
