Created
November 3, 2016 15:54
-
-
Save runemadsen/9dd770a39e5bf01ee9419c1c2d6e8e40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var r = new Rune({ | |
| container: "#canvas", | |
| width: 800, | |
| height: 600 | |
| }); | |
| var myPoly = r.polygon(100, 100) | |
| .lineTo(0, 0) | |
| .lineTo(200, 150) | |
| .lineTo(75, 400); | |
| for(var x = 0; x < r.width; x+= 30) { | |
| for(var y = 0; y < r.height; y+= 30) { | |
| if(myPoly.contains(x, y)) | |
| r.circle(x, y, 15) | |
| } | |
| } | |
| myPoly.removeParent(); | |
| r.play(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment