public AnimatedSprite(String name, int speed){

		this.speed = speed;
		counter = speed;

		//up
		nbSprites = 7;
		up = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			up[i] = new ImageLoader().load("/"+name+"_back.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//down
		down = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			down[i] = new ImageLoader().load("/"+name+"_front.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//left
		left = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			left[i] = new ImageLoader().load("/"+name+"_left.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//right
		right = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			right[i] = new ImageLoader().load("/"+name+"_right.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//attackingUp
		nbSprites = 6;
		attackingUp = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			attackingUp[i] = new ImageLoader().load("/"+name+"_back_attack.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//attackingDown
		attackingDown = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			attackingDown[i] = new ImageLoader().load("/"+name+"_front_attack.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//attackingLeft
		attackingLeft = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			attackingLeft[i] = new ImageLoader().load("/"+name+"_left_attack.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}
		//attackingRight
		attackingRight = new BufferedImage[nbSprites];
		for(int i = 0; i<nbSprites;i++){
			attackingRight[i] = new ImageLoader().load("/"+name+"_right_attack.png").getSubimage(i*WIDTH,0,WIDTH,HEIGHT);
		}

		currentSprite = right; //Starting state.
	}