wasya1212

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. I create simple scene, but I can't see any images or text. All images are loaded. Update is not called. What's wrong? export default class Play extends Phaser.Scene { constructor () { super('game'); this.staticBg = null; this.scrollingBg = null; this.text = null; } preload() { this.load.image('static-bg', 'img/Simpsons_22_15_P1_640x360_279961667900.jpg'); } create() { console.log("play"); // work this.add.image(0, 0, 'static-bg').setOrigin(0, 0).setScale(1.5, 1.7); // doesnt work this.text = this.add.text(10, 70); this.text.setText('Power: ' + 100); } update () { this.text.setText('Power: ' + 100); } } Game.js import Game from "./js/game"; import { Preload, Play } from './js/states'; const config = { title: "Donuts", width: 1000, height: 800, parent: "game", // backgroundColor: "#18216D", pixelArt: true, scene: [ // Preload, Play ], physics: { default: 'arcade', arcade: { debug: false, gravity: { y: 300 } } } }; window.onload = () => { let game = new Game(config); game.start(); };