/
aksjon
/
RNCB_Game
Обзор
Документация
Войти
/
aksjon
/
RNCB_Game
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/scenes/menuScene.js
76 строк
2 KB
aksjon
first_commit
18 май 2025, 19:19
18 май 2025, 19:19
f0429ce
Код
Авторство
О чём код?
export default class menuScene extends Phaser.Scene { constructor() { super({ key: 'menuScene' }); } create() { const backgroundClear = this.add.image(1280 / 2, 720 / 2, 'backgroundClear'); backgroundClear.setDisplaySize(1280, 720); this.scene.launch('UIscene'); const titleText = this.add.image( 1280 / 2, 720 / 2 - 200, 'titleText' ).setOrigin(0.5).setDepth(20).setScale(0.5); //аним. текста titleText.setAlpha(0); this.tweens.add({ targets: titleText, alpha: 1, duration: 1000, ease: 'Power2.out', }); const playButton = this.add.image( 1280 / 2 - 180, 720 / 2 - 10, 'playButton' ).setOrigin(0.5).setDepth(20).setScale(0.5).setInteractive(); //аним. текста playButton.setAlpha(0); this.tweens.add({ targets: playButton, alpha: 1, duration: 1000, ease: 'Power2.out', }); playButton.on('pointerover', () => { this.tweens.add({ targets: playButton, scale: 0.55, duration: 200, ease: 'Power2.out' }); }); //свеч. при навед. playButton.on('pointerout', () => { this.tweens.add({ targets: playButton, scale: 0.5, duration: 200, ease: 'Power2.out', }); }); playButton.on('pointerdown', () => { this.scene.start('Level'); this.musicBack = this.sound.add('musicBack', {loop: true}); this.musicBack.play(); this.musicBack.setVolume(0.3); }) } } /* END OF COMPILED CODE */ // You can write more code here