//package pacman;
//import Thingy;

public class PacMan extends Thingy {
	protected int score = 0;

	public PacMan(String sh) {
		//super.shape = sh;
		shape = sh;
	}

	public boolean eat(Thingy food) {
		boolean eaten = false;
		score += food.hasWorth();
		eaten = true;
		return eaten;
	}

	public int getScore() {
		return score;
	}

  public void moveLeft() {
    if (xPosition > xMin) {
      this.moveTo(xPosition-1,yPosition); }
  }

   public void moveRight() {
    if (xPosition < xMax) {
      this.moveTo(xPosition+1,yPosition); }
  }

  public void moveUp() {
    if (yPosition > yMin) {
      this.moveTo(xPosition,yPosition-1); }
  }

  public void moveDown() {
    if (yPosition < yMax) {
      this.moveTo(xPosition,yPosition+1); }
  }

}
