It does keep going, but it doesn’t keep displaying. Your problem is that you have global variables – in particular, speed (fart) – that you keep incrementing, until the number is so large your sketch doesn’t work anymore.
Try bouncing that value around between -1 and 1, for example:
float gridcelleStr =8;
float gridBredde;
float gridHoejde;
float faktor = 2;
float fart;
float fart_diff = 0.0000002;
float xPos;
float yPos;
float tal;
float strFaktor = 30;
void setup() {
size(1200, 1200, P3D);
gridBredde = floor(120);
gridHoejde = floor(120);
fart = 0;
rectMode(CENTER);
imageMode(CENTER);
}
void draw() {
background(255);
if (fart>1) {
fart_diff = -0.0000002;
}
if (fart<-1) {
fart_diff = 0.0000002;
}
for (int y = 0; y < gridHoejde; y++) {
for (int x = 0; x <gridBredde; x++) {
pushMatrix();
translate(100, 80);
fart += fart_diff;
tal = floor(noise(x/gridHoejde, y / gridBredde, fart) * faktor);
xPos = x * gridcelleStr;
yPos = y * gridcelleStr;
noStroke();
fill(random(0), random(0), random(150, 255));
rect(xPos, yPos, tal * strFaktor, tal * strFaktor);
popMatrix();
}
}
}