Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* global Phaser, tileset */
- BasicGame = {
- };
- BasicGame.Game = function (game) {
- this.map = null;
- this.tileset = null;
- this.layer = null;
- var cursors;
- var player;
- };
- BasicGame.Game.prototype = {
- preload: function () {
- this.game.load.tilemap('kentta', '/assets/kentta.csv', null, Phaser.Tilemap.CSV);
- this.game.load.tileset('tileset', '/assets/tileset.png', 40, 40);
- //this.game.load.image('player', '/assets/player1.png', 42, 42);
- //this.game.load.image('monster', '/assets/monster.png', 42, 42);
- },
- create: function () {
- this.map = this.game.add.tilemap("kentta");
- this.tileset = this.game.add.tileset("tileset");
- this.tileset.setCollisionRange(0, tileset.total-1, true, true, true, true);
- this.layer = this.game.add.tilemapLayer(0, 0, 640, 480, this.tileset, map, 0);
- this.cursors = this.game.input.keyboard.createCursorKeys();
- // this.physics.startSystem(Phaser.Physics.ARCADE);
- // this.cursors = this.game.input.keyboard.createCursorKeys();
- // this.spacekey = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
- player = this.game.add.sprite(40, 40, 'player', 1);
- },
- update: function () {
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement