int WIDTH=799; int HEIGHT=490; int BLOB_R=5; float ECOL=0.9; float EDRAG=0.999; float EG=0.0; int N; int NS; long CT=0; int MODE=0; int ITT=4; float[] PX = new float[4]; float[] PY = new float[4]; float[] PX_OLD = new float[4]; float[] PY_OLD = new float[4]; int STICKA[] = new int[5]; int STICKB[] = new int[5]; float STICKLENGTH[] = new float[5]; boolean RUNNING=true; boolean GRAVITY=false; void setup() { size(800, 590, P2D); reset(); } void draw() { background(0,0,0,0); noFill(); stroke(255); rect(0,0,WIDTH,HEIGHT); renderbuttons(); if(CT++>3000) {reset(); RUNNING=false;} //fuze if (RUNNING) { updatepoints(); for (int i=0;i(WIDTH-BLOB_R)) { PX[i]=(WIDTH-BLOB_R); PX_OLD[i]=(PX[i]+(VX*ECOL)); } else if (PX[i](HEIGHT-BLOB_R)) { PY[i]=(HEIGHT-BLOB_R); PY_OLD[i]=(PY[i]+(VY*ECOL)); } else if (PY[i]=510 && mouseY<=540 && mouseX>0 && mouseX<100) {RUNNING=!RUNNING; if(!RUNNING) {reset();}} if ( mouseY>=510 && mouseY<=540 && mouseX>110 && mouseX<210) {GRAVITY=!GRAVITY;} if ( mouseY>=510 && mouseY<=540 && mouseX>400 && mouseX<750) {MODE=int((mouseX-400)/90); reset();} if ( mouseY>=550 && mouseY<=580 && mouseX>400 && mouseX<750) {ITT=(int((mouseX-400)/90))+1;} } float coox(float cx, float cy, float r, float t) { // calculate x coordinate of point on circle t/1000 of 2PI around return cx+(r*sin(t*TWO_PI/1000)); } float cooy(float cx, float cy, float r, float t) { // calculate x coordinate of point on circle t/1000 of 2PI around return cy+(r*cos(t*TWO_PI/1000)); }