1

1 problem

Exception in thread "main" java.awt.image.RasterFormatException: (x + width) is outside of Raster

at sun.awt.image.ByteInterleavedRaster.createWritableChild(Unknown Source)

at java.awt.image.BufferedImage.getSubimage(Unknown Source)

2 problem

public Spritesheet(String path) {
    try {
        spritesheet = ImageIO.read(getClass().getResource(path));
    } catch (IOException e) {
        e.printStackTrace();
    }
}

public BufferedImage getSprite(int x,int y,int width, int height) {
    return spritesheet.getSubimage(x, y, width, height);

3 problem

    rightPlayer[i] = Game.spritesheet.getSprite(112 +(i*16), 16, 16, 16);

4 problem

        player = new Player(0,0,16,16,spritesheet.getSprite(48, 0, 16, 16));

sorry if you guys dont understand, im new on this.

0 Answers0