Advertisement
Guest User

Preload.js

a guest
Jun 15th, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* global Phaser */
  2.  
  3. BasicGame = {
  4.     //possible global variables
  5.  
  6. };
  7. BasicGame.Preload = function (game) {
  8.    
  9.    
  10. };
  11.  
  12. BasicGame.Preload.prototype = {
  13.    
  14.     init: function () {
  15.         this.input.maxPointers = 1;
  16.        
  17.         this.stage.disableVisibilityChange = true;
  18.         this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
  19.         this.scale.pageAlignHorizontally = true;
  20.         this.scale.forceOrientation(true, false);
  21.         this.scale.setResizeCallback(this.gameResized, this);
  22.         this.scale.setScreenSize(true);
  23.         this.scale.refresh();
  24.  
  25.     },
  26.     //preload assets etc.
  27.     preload: function () {
  28.  
  29.     this.game.load.image('tausta', 'assets/tausta.png');
  30.     this.game.load.image('food', 'assets/food.png');
  31.     this.game.load.image('goal', 'assets/goal.png');
  32.     this.game.load.image('monster', 'assets/monster.png');
  33.     this.game.load.image('player', 'assets/player1.png');
  34.        
  35.      
  36.     },
  37.    
  38.     create: function () {
  39.  
  40.      this.game.state.start('Level1');  
  41.  
  42.     }
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement