何らかの理由で、ブロックが同じ位置にレンダリングされ続けます。誰でも私を助けることができますか?
Block[][] chunk = new Block[Chunk.CHUNK_WIDTH_BLOCKS][Chunk.CHUNK_HEIGHT_BLOCKS];
float[][] positions = new float[Chunk.CHUNK_WIDTH_BLOCKS][Chunk.CHUNK_HEIGHT_BLOCKS];
float frequency = 1.0f / (float) chunk.length;
for (int x = 0; x < chunk.length - 1; x++)
{
for (int y = 0; y < chunk[x].length - 1; y++)
{
positions[x][y] = SimplexNoise.Generate((float) x * frequency, (float) y * frequency);
g.drawRect(positions[x][0], positions[0][y], Block.BLOCK_WIDTH, Block.BLOCK_HEIGHT);
}
}
for (int x = 0; x < Chunk.CHUNK_WIDTH_BLOCKS; x++)
{
for (int y = 0; y < Chunk.CHUNK_HEIGHT_BLOCKS; y++)
{
if (positions[x][y] < 0f)
chunk[x][y] = new Block();
if (positions[x][y] >= -0f)
chunk[x][y] = new Block();
}
}