small changes

This commit is contained in:
lov3b 2022-03-02 19:40:53 +01:00
parent 45c58ec57d
commit 1bad5933b0
2 changed files with 13 additions and 2 deletions

View File

@ -20,6 +20,13 @@ public final class King extends Piece {
icon = ImageIO.read(new File(fileName));
}
public King(boolean white) throws IOException {
// Point p = new Point();
// p.x = 5;
// p.y = white ? 0 : 7;
super(white, white ? new Point(5, 0) : new Point(5, 7));
}
@Override
public void draw(Graphics2D g2) {
super.draw(g2);

View File

@ -24,8 +24,12 @@ public abstract class Piece extends Component {
public void draw(Graphics2D g2) {
g2.drawImage(icon, position.x * Board.SIZE_OF_TILE, position.y * Board.SIZE_OF_TILE, (ImageObserver) this);
// g2.drawImage(icon, 4 * Board.SCALE, 6* Board.SCALE, (ImageObserver) this);
g2.drawImage(
icon,
position.x * Board.SIZE_OF_TILE,
position.y * Board.SIZE_OF_TILE,
(ImageObserver) this
);
}
}