     @default_width = @map.default_width
     @default_height = @map.default_height
     @gravity_point = @update_gravity_point()
-    @init_display()
+    @new_display()
 
   update_area: (@area) ->
     @gravity_point = @update_gravity_point()

    (@y1 < (a * area.x2 + b) < @y2) or
    (@y1 < (c - a * area.x1) < @y2) or
    (@y1 < (c - a * area.x2) < @y2)
  collide: (area) ->
    # fast method
    return false if (@x2 <= area.x1 or @y2 <= area.y1 or @x1 >= area.x2 or @y1 >= area.y2)
    # slow method
    @has_intersection(area)
  joint: (area) ->
    new MapArea2D(_.max(area.x1, @x1), _.max(area.y1, @y1), _.min(area.x2, @x2), _.min(area.y2, @y2))
  space_sub: (area) ->
    joint_area = @joint(area)
    candidates = [
      new MapArea2D(@x1, @y1, @x2, joint_area.y1),
      new MapArea2D(@x1, joint_area.y2, @x2, @y2),
      new MapArea2D(@x1, joint_area.y1, joint_area.x1, joint_area.y2),
      new MapArea2D(joint_area.x2, joint_area.y1, @x2, joint_area.y2)
    ]
    _.select(candidates, (candidate_area) -> candidate_area.is_valid_area())
  is_valid_area: () ->
    @x2 > @x1 and @y2 > @y1

class Map2D
  max_x: 520

  update: () ->
    # next round commands
    @commands = @commander.next_commands()

  turn: (@direction) ->
    @view.turn(@direction)
