final/src/SingleTile.java

19 lines
516 B
Java
Raw Normal View History

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 {
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);
}
}