mirror of
				https://github.com/lov3b/Schack.git
				synced 2025-11-04 07:00:21 +01:00 
			
		
		
		
	small changes
This commit is contained in:
		@@ -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
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user