Skip to content

Commit

Permalink
Draw a triangle on screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Cainã Costa committed Sep 2, 2012
1 parent cce3690 commit ebf3791
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/javascripts/game.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ class window.Game
@canvas = new canvas(width, height, selector)
@canvas.fill "#000000"

startPoint = new Point 0, 0
finishPoint = new Point 640, 480
point1 = new Point 30, 30
point2 = new Point 320, 240
point3 = new Point 480, 480

triangle = new Triangle point1, point2, point3, "#FF0000"
triangle.draw(@canvas)

line = new Line startPoint, finishPoint, 1, "#FF0000"
line.draw @canvas

$(document).ready ->
new Game 640, 480, "canvas"
Expand Down

0 comments on commit ebf3791

Please sign in to comment.