root/Project Folder/bump_n_jump/Trampoline.java

User picture

Author: ahaurw01

Revision: 85 («Previous)


File Size: 659 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.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Trampoline extends StaticLevelElement {
	private static final double DEFAULT_WIDTH = 25;
	private static final double DEFAULT_HEIGHT = 25;

	public Trampoline(double x, double y) {
		super(x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT);
		try {
			image = ImageIO.read(getClass().getResource("../images/trampoline.png"));
		}
		catch (IOException e) {
			System.err.println(e.toString());
		}
	}
	
	public Trampoline(double x, double y, BufferedImage bi) {
		super(x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT, bi);
	}
}