Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. static createGame() {
  2. console.log('game creation phaser called with config');
  3. game = new Phaser.Game(CONFIG);
  4. return game;
  5. }
  6.  
  7. static destroyGame(game) {
  8. console.log("destroying game")
  9. game.destroy();
  10. game = null;
  11. }
  12. }
  13.  
  14. const CONFIG = {
  15. type: Phaser.WEBGL,
  16. width: 720 * window.devicePixelRatio,
  17. height: 500 * window.devicePixelRatio,
  18. scene: [ModeSelectScene, PreLoadScene, PlayGame, GameOverScene],
  19. backgroundColor: 0x0c88c7,
  20. parent: 'game',
  21. scale: {
  22. mode: Phaser.Scale.FIT,
  23. autoCenter: Phaser.Scale.CENTER_BOTH,
  24. parent: 'game',
  25. width: 1334,
  26. height: 750,
  27. },
  28. physics: {
  29. default: 'arcade',
  30. },
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement