     when 'k' then me.moveUp()
     when 'l' then me.moveRight()
   entity.moveTowards me for entity in entities
+  checkForCollisions()
 
 charm.removeAllListeners('^C')
 charm.on '^C', ->

  en

me = e '¤', 'cyan', 15, 15
entities = [
  e '¥', 'red', 7, 5
  e '¥', 'red', 1, 15

  charm.position(0, rows).foreground(message_color).write(current_message)

class Entity
  constructor: (@character, @color) -> @dead = no
  show: ->
    return if @dead
    charm.position( @x, @y ).foreground( @color ).write @character
  die: -> @dead = yes
  moveLeft: -> @x = Math.max 1, @x-1
  moveDown: -> @y = Math.min rows-2, @y+1
  moveUp: -> @y = Math.max 1, @y-1
  moveRight: -> @x = Math.min cols, @x+1
  moveTowards: (other) ->
    return if @dead
    xd = @x - other.x
    yd = @y - other.y
    xda = Math.abs xd
