这真的很奇怪,错误在textures[x]
.
表达式的类型必须是数组类型,但它解析为 BufferedImage
这里的代码有什么问题?
static BufferedImage textures[][] = new BufferedImage[20][20];
public static void loadTextures()
{
try
{
//Loads The Image
BufferedImage textures = ImageIO.read(new URL("textures.png"));
for (int x = 0; x < 1280; x += 1)
{
for (int y = 0; y < 1280; y += 1)
{
textures[x][y] = textures.getSubimage(x*64, y*64, 64, 64);
}
}
} catch (Exception e)
{
e.printStackTrace();
}
}