Minor changes to examples, more code color tweaks for 2b8

This commit is contained in:
Casey Reas
2012-12-20 03:21:07 +00:00
parent cebf10855e
commit 234cbdd85f
13 changed files with 114 additions and 138 deletions
@@ -12,17 +12,16 @@ float gravity = 0.03;
float friction = -0.9;
Ball[] balls = new Ball[numBalls];
void setup()
{
void setup() {
size(640, 360);
noStroke();
for (int i = 0; i < numBalls; i++) {
balls[i] = new Ball(random(width), random(height), random(30, 70), i, balls);
}
noStroke();
fill(255, 204);
}
void draw()
{
void draw() {
background(0);
for (int i = 0; i < numBalls; i++) {
balls[i].collide();
@@ -32,6 +31,7 @@ void draw()
}
class Ball {
float x, y;
float diameter;
float vx = 0;
@@ -90,7 +90,6 @@ class Ball {
}
void display() {
fill(255, 204);
ellipse(x, y, diameter, diameter);
}
}