Created
November 11, 2016 16:41
-
-
Save runemadsen/c897b7bc2b8f059a72bb7543ed4383f5 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(400, 200) | |
.lineTo(0, 0) | |
.lineTo(200, 50) | |
.lineTo(250, 60) | |
.lineTo(200, 150) | |
.lineTo(-200, 150) | |
.lineTo(-250, 60) | |
.lineTo(-200, 50) | |
for(var x = 0; x < r.width; x += 20) { | |
for(var y = 0; y < r.height; y += 20) { | |
if(myPoly.contains(x, y)) { | |
r.circle(x, y, r.random(4, 10)); | |
} | |
} | |
} | |
myPoly.removeParent(); | |
r.draw(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment