e.g
else if (currentImage == nekoPics[4])
currentImage = nekoPics[5];
Need this to run twice, so my cat animation scratches twice, before moving to else, this is probably the worst way to do this, but im interested if you can have an else if execute twice without copy pasting
else if (currentImage == nekoPics[5])
currentImage = nekoPics[4];
and changing the indexes cause that just loops and he'll scratch all the time.
Any help is appreciated
edit: entire code
private void scratch(){
for (int i = xPos; i <getWidth()/2; i+=0){
xPos = getWidth()/2;
// swap images
if (currentImage == nekoPics[0])
currentImage = nekoPics[1];
else if (currentImage == nekoPics[1])
currentImage = nekoPics[2];
else if (currentImage == nekoPics[2])
currentImage = nekoPics[4];
else if (currentImage == nekoPics[4])
currentImage = nekoPics[5];
else
i+=10;
repaint();
pause(150)