PFont medFont; int summe = 0; int boxen = 50; runningBox[] boxes;//DBA800 int R = 0xDB, G = 0xA8, B = 0, MAXThicknes = 15; void setup() { size(800,200); medFont = loadFont("Arial-BoldMT-16.vlw"); textFont(medFont, 16); fill(color(R,G,B)); rect(0, 0, width, height); fill(color(0,0,0)); rect(0,0,width,height); noStroke(); noCursor(); background(R,G,B); framerate(25); //smooth(); boxes = new runningBox[boxen]; for (int i = 0; i < boxen; i++) { boxes[i] = new runningBox(); summe = boxes[i].randomize(1,MAXThicknes,-1,-1, height, width,true,false) + summe + summe % 10; if(summe > width) summe = 0; } } int xx = 0; int yy = 0; int zaehl = 0; void draw() { fill(color(R,G,B,15)); rect(0, 0, width, height); for (int i = 0; i < boxen; i++) { boxes[i].updatePosition(); boxes[i].makeIt(); } if(mouseX == xx && mouseY == yy) zaehl++; else { zaehl = 0; for (int i = 0; i < boxen; i++) boxes[i].mouse(true); } xx = mouseX; yy = mouseY; if(zaehl >= 100) for (int i = 0; i < boxen; i++) boxes[i].mouse(false); else fill(color(255,0,0)); rect(mouseX,mouseY,5,5); } void mouseReleased() { for(int i = 0; boxen > i; i++) boxes[i].matrix(); }