2022-06-02 18:22:17 +01:00
|
|
|
import java.awt.*;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
|
|
|
|
public class SingleTile extends Tile {
|
|
|
|
public BufferedImage tileImage;
|
|
|
|
|
2022-06-03 18:17:03 +01:00
|
|
|
public SingleTile(int x, int y, BufferedImage tileImage) throws SpriteException {
|
2022-06-02 18:22:17 +01:00
|
|
|
super(x, y);
|
|
|
|
|
|
|
|
if (tileImage.getWidth() != tileImage.getHeight()) {
|
|
|
|
throw new SpriteException();
|
|
|
|
}
|
|
|
|
this.tileImage = tileImage;
|
|
|
|
}
|
|
|
|
public void draw(Graphics g){
|
2022-06-02 18:27:27 +01:00
|
|
|
g.drawImage(tileImage, x-GamePanel.camera.x, y, length, length, null);
|
2022-06-02 18:22:17 +01:00
|
|
|
}
|
|
|
|
}
|