【发布时间】:2022-01-18 02:48:37
【问题描述】:
在我的 Phaser 游戏中,我想使用一个类似单元格的背景纹理,它会随着你的移动而移动。
我的想法是像这样在 for 循环中添加每个单元格:
let width=100, height=100;
for(let y=0;y<width;y++){
;
for(let x=0; x<height;x++){
this.physics.add.image(width/2+64*x, height/2+64*y, "snow_field").setScale(4,4);
}
}
问题:游戏变得非常(非常)慢
那么有没有更好/推荐的方法来添加重复的图像/背景?
【问题讨论】:
标签: javascript html phaser-framework