Hi,
I've got problem with condition:
The Ship class's nextFrame() method must set frameIndex to 0 if frameIndex is greater than or equal to the number of frames in the frames list and loopAnimation is true.
My nextFrame() method looks like this:
public void nextFrame() {
frameIndex++;
if(loopAnimation) {
if(frameIndex > frames.size()) {
frameIndex = 0;
}
} else if(frameIndex < frames.size()) {
setMatrix(frames.get(frameIndex));
}
}
It passes all other conditions. I don't have any idea how to change if statements so it will matches the conditions, I tried many options. Can anyone has idea or any hint for that?package com.codegym.games.spaceinvaders;
public enum Direction {
RIGHT,
LEFT,
UP,
DOWN
}