Advertisement
Guest User

Level1.js

a guest
Jun 15th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* global Phaser, tileset */
  2.  
  3. BasicGame = {
  4.    
  5.    
  6. };
  7.  
  8. BasicGame.Game = function (game) {
  9.    
  10.   this.map = null;
  11.   this.tileset = null;
  12.   this.layer = null;
  13.  
  14. var cursors;
  15. var player;
  16. };
  17.  
  18. BasicGame.Game.prototype = {
  19.  
  20.     preload: function () {
  21.  
  22.         this.game.load.tilemap('kentta', '/assets/kentta.csv', null, Phaser.Tilemap.CSV);
  23.         this.game.load.tileset('tileset', '/assets/tileset.png', 40, 40);
  24.         //this.game.load.image('player', '/assets/player1.png', 42, 42);
  25.         //this.game.load.image('monster', '/assets/monster.png', 42, 42);
  26.     },
  27.    
  28.    
  29.     create: function () {
  30.        
  31.         this.map = this.game.add.tilemap("kentta");
  32.         this.tileset = this.game.add.tileset("tileset");
  33.         this.tileset.setCollisionRange(0, tileset.total-1, true, true, true, true);
  34.         this.layer = this.game.add.tilemapLayer(0, 0, 640, 480, this.tileset, map, 0);
  35.  
  36.        
  37.         this.cursors = this.game.input.keyboard.createCursorKeys();
  38.        
  39. //        this.physics.startSystem(Phaser.Physics.ARCADE);
  40. //        this.cursors = this.game.input.keyboard.createCursorKeys();
  41. //        this.spacekey = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
  42.         player = this.game.add.sprite(40, 40, 'player', 1);
  43.  
  44.  
  45.     },
  46.     update: function () {
  47.  
  48.  
  49.     }
  50.  
  51.  
  52. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement