main-menu-scene.js 832 B

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict';
  2. import GameGenerator from '../game-generator';
  3. import {GameType} from '../../utils/const/game-type-enum';
  4. import logo from '../../assets/twelveHeroes_cover.png';
  5. import { PhaserScene } from '../../utils/const/phaser-scene-enum';
  6. export default class MainMenu extends Phaser.Scene {
  7. constructor() {
  8. super({ key: PhaserScene.WORLD, active: false });
  9. }
  10. init(data){
  11. console.log('Init');
  12. }
  13. preload() {
  14. console.log('Preload');
  15. this.load.image('logo', logo);
  16. }
  17. create() {
  18. console.log('create');
  19. let logo = this.add.sprite(0,0,'logo');
  20. logo.setOrigin(0,0);
  21. setTimeout(() => {
  22. console.log('timeout end');
  23. let gameGen = new GameGenerator(GameType.PASSNPLAY);
  24. this.scene.start('World',{heroesSet:gameGen.getHeroesSet()});
  25. }, 5000);
  26. }
  27. update() {
  28. }
  29. }