final/src/SingleTile.java

22 lines
582 B
Java
Raw Normal View History

import java.awt.*;
import java.awt.image.BufferedImage;
public class SingleTile extends Tile {
public int length;
public BufferedImage tileImage;
public SingleTile(int x, int y, BufferedImage tileImage, int length) throws SpriteException {
super(x, y);
if (tileImage.getWidth() != tileImage.getHeight()) {
throw new SpriteException();
}
this.length = length;
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);
}
}