【发布时间】:2020-07-07 20:18:37
【问题描述】:
我想为我的游戏添加背景图片/场景。此代码不起作用。
const config= {
type: Phaser.AUTO,
height: 675,
width: 675,
scene: {
preload,
create,
update,
}
}
const game = new Phaser.Game(config)
const gameState ={
}
function preload() {
this.load.image('background','/background.jpg');
}
function create() {
gameState.move = this.add.circle(325,325,25,'0xffffff');
let bg=this.add.image(0,0,'background');
}
function update() {
}
我能做什么?我是移相器游戏的新手。 我不认为 URL 不正确。但这是输出:enter image description here
【问题讨论】: