Hello everyone! For my game art program, I have to complete these small visual array exercises and I'm stuck on this specific part. I basically have created and filled the necessary arrays, but when i tried to append my arrChoices with my arrImages, the arrChoices stays empty. Hopefully someone can point out what I'm missing here. ```java
PImage[] arrImgs;
PImage[] arrChoices;
//Executed ONCE, at startup. Setup window size, framerate, etc.:
void setup()
{
size(500,500);
fillImgArray();
}
void fillImgArray()
{
arrChoices= new PImage[0];
arrImgs = new PImage[3];
arrImgs[0] = loadImage("Asterix.png");
arrImgs[1] = loadImage("Aya.png");
arrImgs[2] = loadImage("Cat.png");
}
//Execution LOOP (60 times per second by default):
void draw()
{
//printArray(arrImgs);
for ( int i = 0; i<arrChoices.length; i++ )
{
image(arrChoices[i],10+i*arrChoices[i].width,height/2);
}
}
//Executed ONLY (but each time) mouse is pressed:
void mousePressed()
{
}
//Executed ONLY (but each time) a key is pressed:
void keyPressed()
{
if ( key == 1 )
{
arrChoices=(PImage[])append( arrChoices,arrImgs[0]);
}
if ( key == 2 )
{
arrChoices=(PImage[])append(arrChoices,arrImgs[1]);
}
if ( key == 3 )
{
arrChoices=(PImage[])append(arrChoices,arrImgs[2]);
}
}```
