boot.js 876 B

1234567891011121314151617181920212223242526272829303132333435
  1. (function () {
  2. 'use strict';
  3. function Boot() {}
  4. Boot.prototype = {
  5. preload: function () {
  6. this.load.image('preloader', 'assets/preloader.gif');
  7. },
  8. create: function () {
  9. this.game.input.maxPointers = 1;
  10. if (this.game.device.desktop) {
  11. this.game.scale.pageAlignHorizontally = true;
  12. } else {
  13. this.game.scaleMode = Phaser.ScaleManager.SHOW_ALL;
  14. this.game.scale.minWidth = 480;
  15. this.game.scale.minHeight = 260;
  16. this.game.scale.maxWidth = 640;
  17. this.game.scale.maxHeight = 480;
  18. this.game.scale.forceLandscape = true;
  19. this.game.scale.pageAlignHorizontally = true;
  20. this.game.scale.setScreenSize(true);
  21. }
  22. this.game.state.start('preloader');
  23. }
  24. };
  25. window['trexrunner'] = window['trexrunner'] || {};
  26. window['trexrunner'].Boot = Boot;
  27. }());