Showing posts with label visual approach to programming. Show all posts
Showing posts with label visual approach to programming. Show all posts

Saturday, June 8, 2013

Drawing Sprites

The new variable here, C_I, is the number of times you'd like to go through the loop.  To make more variations of what you're drawing, increase C_I and C_C.





function drawShapes() { var coordX = 1, coordY = 1, cvX = 1, cvY = 1, C_I = 5, C_C = 50, i = 1, R; do { R = 5 * i; coordX = C_C * cvX; coordY = C_C * cvY; drawCircle(coordX, coordY, R); cvX++; i++; if (coordX >= w) { cvX = 1; cvY++; } } while (i <= C_I); }