Hi there, I’m new to phaser 3 so i just started to create a game, in that i wanna put bg image but it’s not showing. Plzz help…
Here’s my code:
const game = new Phaser.Game(800,600,Phaser.AUTO,{
preload: preload,
create: create,
update: update
})
// variables
let bg
let platforms
let ground
function preload() {
game.load.image('bg','assets/bg.png')
game.load.image('player','assets/player.jpg')
game.load.image('bricks','assets/mario bricks.png')
game.load.image('ground','assets/ground.png')
}
function create() {
game.physics.startSystem(Phaser.Physics.ARCADE)
bg= this.add.image(0, 0, 'bg')
platforms = game.add.group()
platforms.enableBody = true`Preformatted text`
ground = platforms.create(0,game.world.height - 64,'ground')
ground.scale.seTo(2,2)
ground.body.immovable = true
}
function update() {}