mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 21:00:11 +01:00
small changes
This commit is contained in:
parent
45c58ec57d
commit
1bad5933b0
@ -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);
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user