[SOLVED] PImage[] array inside class shows all images at once

looks like you show

image(img,x,y) ;

only once when ?a key is pressed?


try to use the keyPressed function
and if key [a] is pressed
toggle a class boolean variable

boolean showit = false;

and use it for the show

 if ( showit ) image(img,x,);

add:

void keyPressed() {}
  if ( key == 'a' ) planets[0].showit = ! planets[0].showit;
1 Like