/*Example 1 a = Canvas() count = 10 for( var i = 0; i < count; i++ ) { a.restore() a.fade( .1 ) a.save() a.rotate( .1 * i ) a.polygon( a.center.x, a.center.y, 250, 5).fill( a.randomColor() ) } //*/ //*Example 2 b = Synth() a = Canvas() var size = 0 var sizeInc = 10; var rotation = 0 a.draw = function() { a.fade(.1) rotation += .05 // == 1/20 a.rotate( rotation ) a.polygon( a.center.x, a.center.y, size, 3).stroke( a.randomColor(), 10 ) size += sizeInc; //conditional // || means or // && means and if(size >= 300 || size <= 0) { sizeInc *= -1; //sizeInc = sizeInc * -1; //identical to above } if(size >= 150 && rotation <= 10){ a.circle(a.center.x, a.center.y, 400, a. randomColor()) a.fill('red') b.play(rotation*100) } } //*/ /*Example 3 a = Canvas() a.draw = function() { var squareSize = 200 xCoord = (Mouse.x * a.width) - squareSize / 2, yCoord = (Mouse.y * a.height) - squareSize / 2 a.fade( .1 ) a.square( xCoord, yCoord, squareSize ).fill( a.randomColor() ) } //*/