Using Pictures in Arrays

So I have this little problem here. I want to use my pictures that I made with arrays.
The goal is when you click your mouse the fist picture (array[0]) comes up and when u click again the second picture in array[2] comes up, this goes on until array[4]. I don’t know how to programm it. I wanted to do it with a for loop but it’s not really working. Does any of you have an Idea on how to do it?
Here’s the code I have so far:

PImage base;
PImage haut1;
PImage haut2;
PImage haut3;
PImage haut4;
PImage[] haut;
int hautzaehler;
void setup(){
haut= new PImage[5];
haut[0]= loadImage(“Base.png”);
haut[1]= loadImage(“Haut1.png”);
haut[2]= loadImage(“Haut2.png”);
haut[3]= loadImage(“Haut3.png”);
haut[4]= loadImage(“Haut4.png”);
void draw(){
if (mousePressed){


// ...

void setup() {
  // ...


void draw() {
  // ...

  image(haut[hautzaehler], width >> 1, height >> 0);

void mousePressed() {
  hautzaehler = (hautzaehler + 1) % haut.length;

Thank you for your reply but it’s not really working. I’ve tried it but then when I press my mouse my other pictures I’ve used in a for loop dissapear (I haven’t shared that part of the code). If I use a function and if loop to write your code nothing happens.

Do you have more PImage besides those in haut[]?

Or is your intention to reveal them 1 by 1 after each mousePressed() w/o erasing previous 1s?

I have other Pimages beside the ones in haut[]. I know where the problem was and I could fix it! thank you for your help!