 show_message = ->
   charm.position(0, rows).foreground(message_color).write(current_message)
 
+random = (n) -> Math.floor Math.random() * n + 1
+rr = -> random rows-2
+rc = -> random cols
+
 class Entity
   constructor: (@character, @color) -> @dead = no
   show: ->
     return if @dead
     charm.position( @x, @y ).foreground( @color ).write @character
   die: -> @dead = yes
+  transport: ->
+    @x = rc()
+    @y = rr()
   moveLeft: -> @x = Math.max 1, @x-1
   moveDown: -> @y = Math.min rows-2, @y+1
   moveUp: -> @y = Math.max 1, @y-1

    when 'j' then me.moveDown()
    when 'k' then me.moveUp()
    when 'l' then me.moveRight()
  entity.moveTowards me for entity in entities
  checkForCollisions()


        @moveLeft()
      else if xd < 0
        @moveRight()

e = (ch, co) ->
  en = new Entity ch, co
