import java.awt.*;

public class Sprite {
    protected int x, y;                   // position
    protected final int width, height;    // size
    protected final int dx, dy;           // speed
    private final Image image;

    public Sprite(int x, int y, int width, int height, int dx, int dy, Image image)
    {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.dx = dx;
        this.dy = dy;
        this.image = image;
    }

    public void move()
    {
        x += dx;
        y += dy;
    }

    public void paint(Graphics2D g2)
    {
        g2.drawImage(image, x, y, width, height, null);
    }

    public int getX()
    {
        return x;
    }

    public int getY()
    {
        return y;
    }

    public int getWidth()
    {
        return width;
    }

    public int getHeight()
    {
        return height;
    }
}
