js/MainScene.js
/**
     *   Create the game objects (images, groups, sprites and animations).
     */
Create the game objects (images, groups, sprites and animations).
Create the game objects ( images groups sprites and animations ) .
create() {
        this.inScene = true;
        this.balloons;
        this.ballonSize = document.getElementById('sizeRange').value;
        this.scaleBalloon = this.isHorizontal
            ? this.game.scale.gameSize.width * 0.0002 * this.ballonSize
            : this.game.scale.gameSize.width * 0.0001 * this.ballonSize;
        this.clickBalloonSound = this.sound.add('clickBalloon');
        this.errorSound = this.sound.add('error');
        this.endGameSound = this.sound.add('endGame');
        this.getParams(true);
        this.delay = 1000;
        this.resetValues();
        this.isHorizontal = this.game.scale.gameSize.width > this.game.scale.gameSize.height;
        this.balloons = this.physics.add.group();
        this.generateBalloon = this.time.addEvent({
            delay: this.delay,
            callback: this.createBallon,
            callbackScope: this,
            loop: true,
            paused: false,
        });
        this.timer = this.time.addEvent({
            delay: this.delay,
            callback: this.secondCounter,
            callbackScope: this,
            loop: true,
        });
    }
create ( ) { this . inScene = true ; this . balloons ; this . ballonSize = document . getElementById ( 'sizeRange' ) . value ; this . scaleBalloon = this . isHorizontal ? this . game . scale . gameSize . width * 0.0002 * this . ballonSize : this . game . scale . gameSize . width * 0.0001 * this . ballonSize ; this . clickBalloonSound = this . sound . add ( 'clickBalloon' ) ; this . errorSound = this . sound . add ( 'error' ) ; this . endGameSound = this . sound . add ( 'endGame' ) ; this . getParams ( true ) ; this . delay = 1000 ; this . resetValues ( ) ; this . isHorizontal = this . game . scale . gameSize . width > this . game . scale . gameSize . height ; this . balloons = this . physics . add . group ( ) ; this . generateBalloon = this . time . addEvent ( { delay : this . delay , callback : this . createBallon , callbackScope : this , loop : true , paused : false , } ) ; this . timer = this . time . addEvent ( { delay : this . delay , callback : this . secondCounter , callbackScope : this , loop : true , } ) ; }
Create the game objects (images, groups, sprites and animations).
Create the game objects ( images groups sprites and animations ) .
// Init in scene value to true // Init balloons // Setting balloon scale // Sound manager // get Params // Delays for creating balloons speed // Reset play values // Init is horizontal boolean // Init scale balloon width this will give a responsive ballon size // Init generateBalloon for creating balloon // Instantiate chrono