

public class Mario{
	
	
	//properties
	private String name;
	private int x;
	private int y;
	private int health;
	
	//constructor method
	public Mario(String name, int xval, int yval) {
		this.name = name;
		x = xval;
		y = yval;
		health = 10;
		
	}
	
	//accessor methods
	public int getX() {
		return x;
	}
	
	public int getY() {
		return y;
	}
	
	public int getHealth() {
		return health;
	}
	
	public String getName() {
		return name;
	}
	
	//mutator methods
	
	public void setX(int x) {
		this.x = x;
	}
	
	public void setY(int newY) {
		y = newY;
	}
	
	public void setHealth() {
		if(this.x<0 || this.x>400 || this.y<0 || this.y>400) {
			this.health = this.health-1;
		}
	}
		
	public void resetHealth() {
		this.health = 10;
	}
		
	public String toString() {
		return "Name: "+this.name+"; X: "+this.x+"; Y: "+this.y+"; Health: "+this.health;
	}
	
	
	

}
