Reworking the junkmap
This commit is contained in:
@@ -773,27 +773,27 @@ GameState.prototype.preload = function()
|
|||||||
game.load.spritesheet(s['name'], s['path'], s['width'], s['height'], s['frames'])
|
game.load.spritesheet(s['name'], s['path'], s['width'], s['height'], s['frames'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.map = this.add.tilemap('map');
|
||||||
this.load.tilemap('map',
|
this.load.tilemap('map',
|
||||||
moonlightSettings['map']['path'],
|
moonlightSettings['map']['path'],
|
||||||
null,
|
null,
|
||||||
Phaser.Tilemap.TILED_JSON);
|
Phaser.Tilemap.TILED_JSON);
|
||||||
for (var k in moonlightSettings['map']['tilesets']) {
|
for (var k in moonlightSettings['map']['tilesets']) {
|
||||||
var ts = moonlightSettings['map']['tilesets'][k];
|
var ts = moonlightSettings['map']['tilesets'][k];
|
||||||
map.addTilesetImage(ts['name']);
|
this.map.addTilesetImage(ts['name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameState.prototype.create = function()
|
GameState.prototype.create = function()
|
||||||
{
|
{
|
||||||
map = this.add.tilemap('map');
|
|
||||||
this.map_collision_layers = [];
|
this.map_collision_layers = [];
|
||||||
|
|
||||||
for (var ln in moonlightSettings['map']['layers']) {
|
for (var ln in moonlightSettings['map']['layers']) {
|
||||||
console.log("Preparing layer " + ln);
|
console.log("Preparing layer " + ln);
|
||||||
lp = moonlightSettings['map']['layers'][ln];
|
lp = moonlightSettings['map']['layers'][ln];
|
||||||
layer = map.createLayer(ln);
|
layer = this.map.createLayer(ln);
|
||||||
console.log("Setting collisions on " + ln);
|
console.log("Setting collisions on " + ln);
|
||||||
map.setCollisionBetween(
|
this.map.setCollisionBetween(
|
||||||
lp['collisionBetween'][0],
|
lp['collisionBetween'][0],
|
||||||
lp['collisionBetween'][1],
|
lp['collisionBetween'][1],
|
||||||
lp['collides']
|
lp['collides']
|
||||||
|
|||||||
Reference in New Issue
Block a user