 
   within_boundaries:(x, y) ->
     return false if x < 0 || x > @width || y > @height || y < 0
+
+  star:(x, y) ->
+    color = '#FFFF00'
+    @context.strokeStyle = color
+    @context.beginPath()
+    @context.lineWidth = 1
+    for z in [0...5]
+      @draw_ray(x, y, (360*z/72))
+      @context.stroke()
+
+
+  draw_ray:(x, y, a) ->
+    @context.moveTo x, y
+    coords = @coordinates(x, y, 20, a)
+    @context.lineTo coords.x, coords.y
+
+  coordinates:(x, y, d, a) ->
+    x: x + d * Math.cos(a),
+    y: y + d * Math.sin(a)
+
 
 class Gorilla
   constructor:(@context, @player_number) ->

    x = player.banana.x()
    y = player.banana.y()
    for building in @buildings
      return true if @player_2.check_colission x, y
      return true if @player_1.check_colission x, y
      return true if building.check_colission x, y
    false


  next_player_turn:(player) ->
    next_player = if player.player_number == 2 then 1 else 2

  draw: ->
    @context.drawImage @image(), @x(), @y()

  draw_frame:(time) ->
    @start_time = time
    @draw()
    @calculate_projection()

  calculate_initial_position: ->
    radian = @angle*Math.PI/180
    @dx = @force*Math.cos(radian)
    @dy = @force*Math.sin(radian)-@g*@start_time
