Skip to content

Instantly share code, notes, and snippets.

@drhayes

drhayes/Diff Secret

Created June 19, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drhayes/ef775a97aecaa5549404 to your computer and use it in GitHub Desktop.
Save drhayes/ef775a97aecaa5549404 to your computer and use it in GitHub Desktop.
Fixed Level1.js for ekeimaja
[~/Downloads/Labyrinth] ➔ diff Level1.old.js src/Level1.js
12,14d11
< BasicGame.Game.prototype = Object.create(Phaser.State.prototype);
< BasicGame.Game.prototype.constructor = BasicGame.Game;
<
23a21,24
> BasicGame.Game.prototype = Object.create(Phaser.State.prototype);
> BasicGame.Game.prototype.constructor = BasicGame.Game;
>
>
28,29c29
< debugger;
< this.game.load.tileset('tileset', '/assets/tileset.png', 40, 40);
---
> this.game.load.image('tileset', '/assets/tileset.png', 40, 40);
36,38c36,41
< 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.tileset = this.map.addTilesetImage('tileset');
> this.layer = this.map.createLayer(0, 640, 480);
> // this.layer = this.game.add.tilemapLayer(0, 0, 640, 480, this.tileset, this.map, 0);
> // this.tileset = this.game.add.tileset('tileset');
> this.map.setCollisionBetween(0, this.tileset.total-1, true, this.layer, true);
>
/* global Phaser, tileset */
BasicGame = {
};
BasicGame.Game = function (game) {
Phaser.State.call(this);
this.map = null;
this.tileset = null;
this.layer = null;
var cursors;
var player;
};
BasicGame.Game.prototype = Object.create(Phaser.State.prototype);
BasicGame.Game.prototype.constructor = BasicGame.Game;
BasicGame.Game.prototype.preload = function() {
this.game.load.tilemap('kentta', '/assets/kentta.csv', null, Phaser.Tilemap.CSV);
this.game.load.image('tileset', '/assets/tileset.png', 40, 40);
},
BasicGame.Game.prototype.create = function() {
this.map = this.game.add.tilemap('kentta', 40, 40);
this.tileset = this.map.addTilesetImage('tileset');
this.layer = this.map.createLayer(0, 640, 480);
// this.layer = this.game.add.tilemapLayer(0, 0, 640, 480, this.tileset, this.map, 0);
// this.tileset = this.game.add.tileset('tileset');
this.map.setCollisionBetween(0, this.tileset.total-1, true, this.layer, true);
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);
},
BasicGame.Game.prototype.update = function() {
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment