p5.js star example
The star() function created for this example is capable of drawing a wide range of different forms. Try placing different numbers into the star() function calls within draw() to explore.
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.3/p5.min.js"></script>
<body>
</body>
<head>
<div id=cell>
</div>
</head>
CSS
body {
background-color:lightblue;
}
cell{
background-color:red;
width:54;
height:54;
}
JavaScript
function setup() {
createCanvas(400,400);
}
var scl;
function draw() {
ceil(12)
for (var Cell=0;Cell<scl;Cell++){
rect(x,y,scl,scl)
rect(x*scl,y*scl,scl,scl)
fill(0)
x=x+random(1)
y=y+random(1)
}
}
scl =9;
function ceil(cell){
this.cell = this.cell;
cell = [];
var scl =11;
var create =CanvasRenderingContext2D.create(cell);
create = document.firstChild(cell);
document.newElement(cell)
Document.getDocument.create(cell);
}
x=0;
y=0;