Examples updates for 2.0

This commit is contained in:
Casey Reas
2011-07-17 06:50:01 +00:00
parent d996b52e66
commit 84dd359b1e
33 changed files with 305 additions and 280 deletions

View File

@@ -10,12 +10,11 @@ int unit = 40;
int count;
Module[] mods;
void setup() {
size(320, 240);
size(640, 360);
background(176);
noStroke();
smooth();
int wideCount = width / unit;
int highCount = height / unit;
count = wideCount * highCount;
@@ -24,13 +23,13 @@ void setup() {
int index = 0;
for (int y = 0; y < highCount; y++) {
for (int x = 0; x < wideCount; x++) {
mods[index++] = new Module(x*unit, y*unit, unit/2, unit/2, random(0.05, 0.8));
mods[index++] = new Module(x*unit, y*unit, unit/2, unit/2, random(0.05, 0.8), unit);
}
}
}
void draw() {
background(0);
for (int i = 0; i < count; i++) {
mods[i].update();
mods[i].draw();