import java.awt.*;
import java.awt.image.*;

class MovingSprite extends Sprite
{
	// speed in the x and y direction
	int dx, dy;

	public MovingSprite(Image image)		// initialize sprite with an image
	{
		super(image);
		dx = 0;
		dy = 0;
	}

	public MovingSprite(Image image, boolean bValue)		// initialize sprite with an image
	{
		super(image, bValue);
		dx = 0;
		dy = 0;
	}

	public void setSpeed(int dx, int dy)
	{
		this.dx = dx;
		this.dy = dy;
	}

	public int getXSpeed()
	{
		return dx;
	}

	public int getYSpeed()
	{
		return dy;
	}

	public void nextState()
	{
		setPosition(getXPosition()+dx, getYPosition()+dy);
	}
}