Hi, i am making a game in java for fun. This game will hava alot graphics. ex player walking, running, jumping, punching, falling, dying, kicking, etc...

i want a best for of loading sprite sheet and animation method. so this way i will have alot of control over making animations. here is key things i want it to do.

i want to loop though 4 images only onces. ex when making my player jump.
i want to keep loop though 4 images. ex when user hold right key down for walking.
i want to slow down the animation.
i want to make speed up the animation
making animation,sprite while having less class as possiable.

the way i am doing is working but it was a lot classess and code seem to be alot in player class too.

sprite sheet class
bufferedimageload class
animation class
main class (load image in main class)
player class(make animation)


sprite sheet class.
Code:
 public class sprite_sheet{
	public BufferedImage spriteSheet;
	
	public sprite_sheet(BufferedImage ss){
		this.spriteSheet = ss;
	}
	
	public BufferedImage grabSprite(int x, int y, int width, int height){
		BufferedImage sprite = spriteSheet.getSubimage(x, y, width, height); 
		return sprite;
	}
}
bufferedimageload class
Code:
public class BufferedImageLoad {
	public BufferedImage loadImage(String path)throws IOException{
		URL url = this.getClass().getResource(path);
		BufferedImage img = ImageIO.read(url);
		return img;
	}
}
aniamtion class
Code:
public class animation {
	private ArrayList<BufferedImage> frames;
	public BufferedImage sprite;
	private volatile boolean running = false;
	private long previous_time;
	private int current_frame;
	private long speed;
	private int frame_pause;
	
	public animation(ArrayList<BufferedImage> iframes){
		this.frames = iframes;
	}
	
	public void setSPEED(long value)
	{ this.speed = value; }
	
	//crete animation
	public void update(long time){
		if(running){
			if(time - previous_time >= speed){
				//update the animation
				current_frame++; //go to next frame
				try{
					sprite = frames.get(current_frame); //set the sprite to current frame
				}
				catch(IndexOutOfBoundsException e){
					current_frame = 0;                 //reset current frame
					sprite = frames.get(current_frame); //set sprite to that current frame
				}
				previous_time = time; //allow to loop
			}
		}//end of while loop
	}
	
	public void play(){
		running = true;
		previous_time = 0;
		frame_pause = 0;
		current_frame = 0;
	}
	
	public void stop(){
		running = false;
		previous_time = 0;
		frame_pause = 0;
		current_frame = 0;
	}
	
	public void pause(){
		frame_pause = current_frame;
		running = false;
	}
	
	public void resume(){
		current_frame = frame_pause;
		running = true;
	}
}


main class (load image in main class)
Code:
buffered_class = new BufferedImageLoad();
		try{
			player_sheet = buffered_class.loadImage("image/sprite_sheet/player_sheet.png");
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}

player class(make animation)
//CONSTRUCTOR
Code:
	public player(int ix, int iy, int iwidth, int iheight, main m)
	{
		x = ix;
		y = iy;
		width = iwidth;
		height = iheight;
		
		/*** animation ***/
		sprite_sheet ss = new sprite_sheet(m.getSpriteSheet());
		player_walk_right_sprites.add(ss.grabSprite(6, 530, 34, 44));    //create animation - x, y, width, height of cut image
		player_walk_right_sprites.add(ss.grabSprite(47, 530, 34, 44));   //create animation - x, y, width, height of cut image
		player_walk_right_sprites.add(ss.grabSprite(88, 530, 36, 44));
		player_walk_right_sprites.add(ss.grabSprite(130, 530, 34, 44));
		player_walk_right_sprites.add(ss.grabSprite(167, 530, 34, 44));
		player_walk_right_sprites.add(ss.grabSprite(204, 530, 34, 44));
		player_walk_right_sprites.add(ss.grabSprite(246, 530, 34, 44));
		player_walk_right_sprites.add(ss.grabSprite(288, 530, 35, 44));
		player_walk_right_sprites.add(ss.grabSprite(328, 530, 39, 44));
		player_walk_right_sprites.add(ss.grabSprite(374, 530, 35, 44));
		player_walk_right_sprites.add(ss.grabSprite(414, 530, 35, 44)); 
		player_walk_right_sprites.add(ss.grabSprite(453, 530, 35, 44));
		
		player_stand_right_sprites.add(ss.grabSprite(228, 7, 32, 39));
		player_stand_right_sprites.add(ss.grabSprite(268, 7, 32, 39));
		player_stand_right_sprites.add(ss.grabSprite(309, 7, 32, 39));
		player_stand_right_sprites.add(ss.grabSprite(349, 7, 32, 39));
		
	
		
		//animation
		animation_class = new animation(player_walk_right_sprites);
		animation_class.setSPEED(150);
animation_class.play();
}