import java.awt.*;

public class Robot {

    private int x;
    private final int y;
    private final int speed;

    public Robot(int x, int y, int speed) {
        this.x = x;
        this.y = y;
        this.speed = speed;
    }

    public void walk() {
        x += speed;
    }

    public int getX() { return x; }
    public void setX(int x) { this.x = x; }

    public void draw(Graphics2D g2) {
        Color bodyColor = new Color(180, 220, 255);  // pastel blue
        Color darkColor = new Color(120, 160, 200);  // muted blue outline
        Color eyeColor  = new Color(255, 160, 180);  // pastel pink

        // Body (wider)
        g2.setColor(bodyColor);
        g2.fillRoundRect(x - 6, y + 10, 44, 38, 8, 8);
        g2.setColor(darkColor);
        g2.setStroke(new BasicStroke(1.5f));
        g2.drawRoundRect(x - 6, y + 10, 44, 38, 8, 8);

        // Head (narrower)
        g2.setColor(bodyColor);
        g2.fillRoundRect(x + 2, y - 18, 28, 26, 8, 8);
        g2.setColor(darkColor);
        g2.setStroke(new BasicStroke(1.5f));
        g2.drawRoundRect(x + 2, y - 18, 28, 26, 8, 8);

        // Eyes
        g2.setColor(eyeColor);
        g2.fillRoundRect(x + 5,  y - 12, 8, 7, 3, 3);
        g2.fillRoundRect(x + 19, y - 12, 8, 7, 3, 3);
    }
}
