Notes:
Looks like some party wallpaper to us, made of dots (TNTDisks)!
Features:
| Comments: |
var dotCount = 0;
var aColor;
var radius;
var center;
//nested loop: fill from upper left to lower right, horizontally
for(var y = 8; y >= -8; y-=2){
for(var x = -8; x <= 8; x+=2){
center = new TNTPoint(x,y);
if(dotCount % 2 == 0){
aColor = red;
radius = 1;
}else{
aColor = blue;
radius = .5;
}
var aDisk = new TNTDisk(center, radius, aColor, null);
aDisk.drawTNTDisk(context);
dotCount++;
}//end inner loop
}//end outer loop
|
|---|---|
| Even More: |
We were able to output the dotCount to the HTML above by targeting a paragraph id and then assigning its 'innerHTML' the value of dotCount. Look at the code! |
