答案 0 :(得分:0)
在功能renderBG()
function renderBG () {
let size = 800, pointX = [], pointY = [];
push();
noStroke();
noFill();
for (let x = round(game.camera.x) - width; x < round(game.camera.x) + width; x++) { // removed the part where you devide width/2
if (x % size >= - 1 && x % size <= 1) {
for (let y = round(game.camera.y) - height; y < round(game.camera.y) + height; y++) { // removed the part where you devide height/2
if (y % size >= - 1 && y % size <= 1) {
image(game.graphics.ground, x, y, size , size);
}
}
}
}
pop();
}
它的速度变慢了一点,但是我认为这是因为图片很大/很详细。