i'm am trying to animate my character so that when the player pressed space the image of the character with a sword comes up like a slide show. it also has to apply in the direction the character is facing i have a boolean variable facingRight. I'm trying to make it work with an array and a while loop but for some reason it doesn't work here is the array code.
all images are .png
player_0 is the default image with the player facing to the right.
player_1 is the same as the first but is facing left.
all the images for 2-5 are facing the left and 6-9 are facing to the right
String[] images = {"player_0","player_1","player_2","player_3","player_4","player_5","player_6","player_7","player_8","player_9",};