import theater.*;

/**
 * Übertragen aus dem Greenfoot-Szenario balloons
 * <p>
 * </p>
 * A balloon flows from bottom to top.
 */
public class Balloon extends Actor {

	public Balloon() {
		setImage("balloon1.gif");
		setPriority(2);
		setZCoordinate(1);
	}

	/**
	 * Make the balloon go up.
	 */
	public void run() {
		setLocation(getColumn(), getRow() - 1);
		if (getRow() == 0) {
			((BalloonWorld) getStage()).gameOver();
		}
	}

	/**
	 * Pop this balloon.
	 */
	public void pop() {
		Performance.getPerformance().playSound("pop.wav");
		((BalloonWorld) getStage()).countPop();
		getStage().remove(this);
	}
}
