     if bullet.position.x < 0 || bullet.position.x > WIDTH then bullets.splice i, 1
     if bullet.position.y < 0 || bullet.position.y > HEIGHT then bullets.splice i, 1
 
-    # TODO: bullet collision
+    # bullet collision
+    for id, player of players
+      if bullet.owner != player.id and player.dead is null and player.collidesWith(bullet) 
+        player.health -= bullet.damage
+        bullets.splice i, 1
+        util.log "Bullet collision! Player health: #{player.health}"
 
   # Send to all connections
   socket.sockets.emit 'data', { players: players, bullets: bullets }

WIDTH = 1000
HEIGHT = 600
MAX_VELOCITY = 0.25

players = {}
bullets = []


  # Update player position
  for id, player of players

    # Handle health
    if player.health < 0 and player.dead is null
      player.dead = Date.now()
    else if player.health < player.maxHealth and player.dead is null
      player.health += player.regen
    else if player.dead? and Date.now() - player.dead > RESPAWN_TIMER
      respawn player

    if player.dead? then continue

    player.rotation += player.rotate * delta * 2
    player.acceleration.x = Math.cos(player.rotation) * player.thrust * delta
    player.acceleration.y = Math.sin(player.rotation) * player.thrust * delta
