Processing Sachen Random bewegen lassen?

1 Antwort

Beispiel

int rx = round(random(-10,10));

int ry = round(random(-10,10));

int x = 200;

int y = 200;

void setup(){

size(500,500);

}

void draw(){

background(0);

rect(x,y,40,40);

x = x + rx;

y = y + ry;

rx = round(random(-10,10));

ry = round(random(-10,10));

}

Viel Spaß noch ;)