Java 2D Fighting game

Ok well since i have about 120 views and no replies im guessing there is something wrong with my question.

Here is a more specific question i have, When doing animation would it be wise to have the player class have an Array of images for the right walking, and an array of images for the left walking, and then in the update function use another array called “currentArray” or w.e (which will be set when player is set to move right or left)…

Also, i seem to have trouble creating an Image array, i remember doing it before but cannot anymore. I feel like a noob but something like this isnt working.

Image[] anim = new Image[5]

anim[0] = insertWayToGetImage;

Deleted

First post UPDATED.

I would create two classes. One is the Player class that defines what your player is doing. For example:

enum Action {NA, LEFT, RIGHT, JUMP};

Then second, you have the PlayerSprite class which renders the player on the screen. You could do it as described: have an array of images for each type of actions:

Action action = player.getAction();
if (action == Action.LEFT) {
  // render correct image for left...
}

The Player class doesn’t know anything about images. It just purely contains the player information. The PlayerSprite will need a timer to identify the correct image (in the series) to render it onto the screen.

Your probably going to want to create an Animation class too otherwise its going to get very unwieldy.

Make a Player Object that contains an Animation. and inside it have a Method that changes the Animation when a certain Button is pressed. Make sure all the Animations are loaded as soon as the program starts to run.