 
   position_at_y:() ->
     return  640-@height
+
+  end_position:() ->
+    return @position_at_x()+@width
 
   draw:(@x, @y) ->
     @context.fillStyle = @color

class Building
  constructor:(context) ->
    @context = context
    @width = 100
    @base_height = 135
    @randomize_color()

  position_at_x:() ->

    @canvas = document.getElementById "gorillas"
    @context = @canvas.getContext "2d"
    @color = '#00FFFF'
    @padding = 1
    @buildings = []

  draw_buildings:()->
    position = 0
    for [1...10]
      building = @draw_building(position)
      position = building.end_position() + @padding


  draw_building:(x) ->
    building = new Building(@context)

    y = Math.floor(Math.random()*300)
    building.draw(x, y)
    @buildings.push building
    return building

  draw_the_sun: ->
    sun = new Sun(@context)
