My program keeps not responding when starting the program when generating the terrain.
this is the code. I Believe that it's the for loop.
Random Random = new Random();
int numberHeight = Random.nextInt(5);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glColor3f(0.5f,0.5f,1.0f);
int Bottom = Height - 100;
for(int xOffset = 0; xOffset < Width; xOffset = xOffset + 100){
for(int currentHeight = 0; currentHeight < numberHeight; currentHeight = currentHeight++){
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glVertex2f(xOffset,Bottom - currentHeight * 100);
GL11.glVertex2f(xOffset + 100,Bottom - currentHeight * 100);
GL11.glVertex2f(xOffset + 100,Bottom - currentHeight * 100 - 100);
GL11.glVertex2f(xOffset,Bottom - currentHeight * 100 - 100);
}
GL11.glEnd();
if(currentHeight >= numberHeight)break;
}
}