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

You are still doing the same issue ! You are calling planet spawn from draw ! The random num will be picked 60 FPS ! Hence causing the flickering. Again to avoid this you can make a variable inside the class + a method for e.g. called rand and getRandomNum and put it inside your Planet clas the keypressed where it will be called from. This will ensure that only a random picture is picked per key press.