root/Project Folder/bump_n_jump/Warp.java

User picture

Author: ahaurw01

Revision: 85 («Previous)


File Size: 864 Bytes

(April 07, 2009 16:46 UTC) About 3 years ago

added a new folder called Project Folder that contains the Eclipse project i've been using. Should be able to compile & run when put into eclipse.

 
Show/hide line numbers
package bump_n_jump;

import java.io.IOException;

import javax.imageio.ImageIO;

/**
 * A Warp objects sucks the player in and spits out at a different location in the level.
 * @author Aaron Haurwitz
 *
 */
public class Warp extends StaticLevelElement {
	private double exitX, exitY;
	private static final double DEFAULT_WIDTH = 25, DEFAULT_HEIGHT = 25;
	
	public Warp(double x, double y) {
		super(x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT);
		try {
			image = ImageIO.read(getClass().getResource("../images/warp.png"));
		}
		catch (IOException e) {
			System.err.println(e.toString());
		}
	}

	

	public double getExitX() {
		return exitX;
	}

	public void setExitX(double exitX) {
		this.exitX = exitX;
	}

	public double getExitY() {
		return exitY;
	}

	public void setExitY(double exitY) {
		this.exitY = exitY;
	}
}