class Scene1 extends Phaser.Scene {
    constructor() {
        super("idle");
    }

    create() {
        console.log("test");
        this.clickSound = this.sound.add('buttonSnd');
        this.clickSound.play();
        this.idle_background = this.add.image(0, 0, "backgroundIdle").setOrigin(0,0);
        

        this.play_button = this.add.image(550, 1500, "startButton");
        this.play_button.setInteractive({ useHandCursor: true });
        this.play_button.setAlpha(1);
        this.play_button.on('pointerup', function (pointer) {
            this.changeScene();
        }, this);

        this.tweens.add({
            targets: this.play_button,
            scale: 1.1, // Aumenta el tamaño en un 10%
            duration: 800, // Duración de 800 ms
            yoyo: true, // Regresa al tamaño original
            repeat: -1, // Repite indefinidamente
            ease: 'Sine.easeInOut' // Suaviza el efecto
        });
    }

    changeScene() {
        this.game.global.score = 0;
        this.scene.start('game');
        this.clickSound.play();
    }
}
