Hey! I need help with figuring out, how to make this outcome possible? Create a program that allows the user to click 20 times on the screen. Once the 20th click has been pressed, circles will appear on the run window where the user clicked.
First of all, you need a counter. I suggest using an integer to store it. Upon every click, increase it by 1 and add the position of the mouse into an array (can use x = new int[]; y = new int[] OR PVector pos = new PVector[] OR int pos[][] = new int[][2]; //[i][0] - x position [i][1] - y position OR you can use ArrayLists that are flexible in size).
In draw() you just add something like
if(counter>=20) {
//run through the array and display the circles there. I suggest using a for-loop
noLoop(); //optional to pause the program.
}