a = Canvas() count = 10 drawTriangles = function(){ a.clear() for( var i = 0; i < count; i++ ) { //a.clear() a.rotate( .1 * rndi(10) ) a.polygon( a.center.x + i*10, a.center.y, 250, 3).stroke( a.randomColor() ) } } a.draw = function(){ //anything in the special 'draw' member/property function // will be drawn approximately 30 times per second // i.e. the “draw loop” or, more technically speaking, the graphics thread drawTriangles() } // just some notes on incrementing variables // r += 0.1 equals r = r + 0.1 // r++ equals r = r + 1