pos[0] = mouseX; pos[1] = mouseY; // Add current mouseX/mouseY-Array to Array-List polygon.add(pos);
But doesn’t the above code replace the array’s content so that the same array but with different numbers inside (the mouse position in each frame) is added every frame?