import processing.core.*; import processing.xml.*; import java.applet.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; import java.net.*; import java.text.*; import java.util.*; import java.util.zip.*; import java.util.regex.*; public class pattern_one extends PApplet { /* Title: pattern one Description: a bunch of dots falling, changing their speed each third of the stage. author: dRNn. July 07, 2009*/ //global variables int ballCount = 600; int ballSize = 1; int ballSpeed = 2; //here is determined the size of the arrays to hold enought data for all the balls float[]xSpeed = new float[ballCount]; float[]ySpeed = new float[ballCount]; float[]xPos = new float[ballCount]; float[]yPos = new float[ballCount]; float[]wdth = new float[ballCount]; float[]ht = new float[ballCount]; //initialize sketch public void setup(){ size(300, 300); background(0); noStroke(); frameRate(30); //initiliaze values for each ball for(int i=1; iheight/3){ yPos[i] += ySpeed[i]*2; } if (yPos[i]>height*2/3){ yPos[i] += (ySpeed[i])*3; } } } static public void main(String args[]) { PApplet.main(new String[] { "--bgcolor=#ECE9D8", "pattern_one" }); } }