     @ctx              = @canvas.getContext '2d'
 
     @projectiles      = []
+    @enemies          = [new Enemy @]
 
     $('body').append @canvas
 
     @controller = new Controller @
     @player     = new Player @
-    @enemy      = new Enemy @
 
   timestamp: ->
     window.performance.now()
 
   update: ->
     @player.update()
-    @enemy.update()
+    @updateEnemies()
     @updateProjectiles()
+    @handleCollisions()
 
   render: ->
     @renderBackground()
     @player.render()
-    @enemy.render()
+    @renderEnemies()
     @renderProjectiles()
 
   frame: ->

    for projectile of @projectiles
      @projectiles[projectile].render()

  addProjectile: (projectile)->
    @projectiles.push projectile


class Enemy extends Entity

  constructor: (@game)->
    super 0, 0, 100, 100, 10, @game
    @y =  @height
    @x =  @game.width + @width
    @move @x, @y

  render: ->
    @game.ctx.drawImage @game.assets.enemyShip, @x, @y, @width, @height

  update: ->
    @move(@x - @speed)
    @move(@game.width + @width) if @x < -@width

  move: (x)->
    super x, @y
