Reworking the junkmap
BIN
moonlight/gfx/tiles/001-Grassland01.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
moonlight/gfx/tiles/002-Woods01.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
moonlight/gfx/tiles/003-Forest01.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
moonlight/gfx/tiles/004-Mountain01.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
moonlight/gfx/tiles/005-Beach01.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
moonlight/gfx/tiles/006-Desert01.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
moonlight/gfx/tiles/007-Swamp01.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
moonlight/gfx/tiles/008-Snowfield01.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
moonlight/gfx/tiles/009-CastleTown01.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
moonlight/gfx/tiles/010-CastleTown02.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
moonlight/gfx/tiles/011-PortTown01.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
moonlight/gfx/tiles/012-PortTown02.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
moonlight/gfx/tiles/013-PostTown01.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
moonlight/gfx/tiles/014-PostTown02.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
moonlight/gfx/tiles/015-ForestTown01.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
moonlight/gfx/tiles/016-ForestTown02.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
moonlight/gfx/tiles/017-MineTown01.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
moonlight/gfx/tiles/018-MineTown02.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
moonlight/gfx/tiles/019-DesertTown01.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
moonlight/gfx/tiles/020-DesertTown02.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
moonlight/gfx/tiles/021-SnowTown01.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
moonlight/gfx/tiles/022-SnowTown02.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
moonlight/gfx/tiles/023-FarmVillage01.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
moonlight/gfx/tiles/024-FarmVillage02.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
moonlight/gfx/tiles/025-Castle01.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
moonlight/gfx/tiles/026-Castle02.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
moonlight/gfx/tiles/027-Castle03.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
moonlight/gfx/tiles/028-Church01.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
moonlight/gfx/tiles/029-Church02.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
moonlight/gfx/tiles/030-Ship01.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
moonlight/gfx/tiles/031-Ship02.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
moonlight/gfx/tiles/032-Heaven01.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
moonlight/gfx/tiles/033-Heaven02.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
moonlight/gfx/tiles/034-Bridge01.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
moonlight/gfx/tiles/035-Ruins01.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
moonlight/gfx/tiles/036-Shop01.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
moonlight/gfx/tiles/037-Fort01.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
moonlight/gfx/tiles/038-Fort02.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
moonlight/gfx/tiles/039-Tower01.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
moonlight/gfx/tiles/040-Tower02.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
moonlight/gfx/tiles/041-EvilCastle01.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
moonlight/gfx/tiles/042-EvilCastle02.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
moonlight/gfx/tiles/043-Cave01.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
moonlight/gfx/tiles/044-Cave02.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
moonlight/gfx/tiles/045-Cave03.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
moonlight/gfx/tiles/046-Cave04.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
moonlight/gfx/tiles/047-Mine01.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
moonlight/gfx/tiles/048-Sewer01.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
moonlight/gfx/tiles/049-InnerBody01.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
moonlight/gfx/tiles/050-DarkSpace01.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
@@ -26,13 +26,97 @@ SPRITE_TOWNSFOLK_GUARD2 = 10;
|
|||||||
var moonlightSettings = {
|
var moonlightSettings = {
|
||||||
'map' : {
|
'map' : {
|
||||||
'tilesets': [
|
'tilesets': [
|
||||||
{ 'name': 'Macks-tilea2',
|
{
|
||||||
'path': 'gfx/Macks-tilea2.png'
|
'name': '009-CastleTown1',
|
||||||
|
'path': 'gfx/tiles/009-CastleTown1.png'
|
||||||
},
|
},
|
||||||
{ 'name': 'Macks-tilea3',
|
{
|
||||||
'path': 'gfx/Macks-tilea3.png'
|
'name': '010-CastleTown02',
|
||||||
|
'path': 'gfx/tiles/010-CastleTown2.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '025-Castle01',
|
||||||
|
'path': 'gfx/tiles/025-Castle01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '026-Castle02',
|
||||||
|
'path': 'gfx/tiles/026-Castle02.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '027-Castle03',
|
||||||
|
'path': 'gfx/tiles/027-Castle03.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '027-Castle03',
|
||||||
|
'path': 'gfx/tiles/027-Castle03.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '028-Church01',
|
||||||
|
'path': 'gfx/tiles/028-Church01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '029-Church02',
|
||||||
|
'path': 'gfx/tiles/029-Church02.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '034-Bridge01',
|
||||||
|
'path': 'gfx/tiles/034-Bridge1.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '035-Ruins01',
|
||||||
|
'path': 'gfx/tiles/035-Ruins01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '037-Fort01',
|
||||||
|
'path': 'gfx/tiles/037-Fort01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '038-Fort02',
|
||||||
|
'path': 'gfx/tiles/038-Fort02.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '039-Tower01',
|
||||||
|
'path': 'gfx/tiles/039-Tower01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '040-Tower02',
|
||||||
|
'path': 'gfx/tiles/040-Tower02.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '041-EvilCastle01',
|
||||||
|
'path': 'gfx/tiles/041-EvilCastle01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '042-EvilCastle02',
|
||||||
|
'path': 'gfx/tiles/042-EvilCastle02.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '048-Sewer01',
|
||||||
|
'path': 'gfx/tiles/048-Sewer01.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': '004-Mountain01',
|
||||||
|
'path': 'gfx/tiles/004-Mountain01.png'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
'layers': {
|
||||||
|
'0 - NonCollide Base': {
|
||||||
|
'collides': false,
|
||||||
|
'collisionBetwen': [0, 0]
|
||||||
|
},
|
||||||
|
'0 - Collide Base': {
|
||||||
|
'collides': true,
|
||||||
|
'collisionBetween': [0, 9999]
|
||||||
|
},
|
||||||
|
'0 - Collide Overlay - Foliage': {
|
||||||
|
'collides': true,
|
||||||
|
'collisionBetween': [0, 9999]
|
||||||
|
},
|
||||||
|
'0 - NonCollide Overlay - Foliage': {
|
||||||
|
'collides': false,
|
||||||
|
'collisionBetween': [0, 9999]
|
||||||
|
}
|
||||||
|
},
|
||||||
'collisionRange': [385, 512],
|
'collisionRange': [385, 512],
|
||||||
'path': 'gfx/junkmap.json'
|
'path': 'gfx/junkmap.json'
|
||||||
},
|
},
|
||||||
@@ -697,12 +781,22 @@ GameState.prototype.create = function()
|
|||||||
var ts = moonlightSettings['map']['tilesets'][k];
|
var ts = moonlightSettings['map']['tilesets'][k];
|
||||||
map.addTilesetImage(ts['name']);
|
map.addTilesetImage(ts['name']);
|
||||||
}
|
}
|
||||||
layer = map.createLayer('Tile Layer 1');
|
|
||||||
layer.resizeWorld();
|
this.map_collision_layers = [];
|
||||||
map.setCollisionBetween(
|
|
||||||
moonlightSettings['map']['collisionRange'][0],
|
for (var ln in moonlightSettings['map']['layers']) {
|
||||||
moonlightSettings['map']['collisionRange'][1]
|
lp = moonlightSettings['map']['layers']['lp'];
|
||||||
|
layer = map.createLayer(ln);
|
||||||
|
map.setCollisionbetween(
|
||||||
|
lp['collisionBetween'][0],
|
||||||
|
lp['collisionBetween'][1],
|
||||||
|
lp['collides']
|
||||||
);
|
);
|
||||||
|
if ( lp['collides'] == true )
|
||||||
|
this.map_collision_layers.push(layer);
|
||||||
|
if ( lp['resizeWorld'] == true )
|
||||||
|
layer.resizeWorld();
|
||||||
|
}
|
||||||
|
|
||||||
player = this.add.sprite(10, 10, 'player');
|
player = this.add.sprite(10, 10, 'player');
|
||||||
this.physics.arcade.enable(player);
|
this.physics.arcade.enable(player);
|
||||||
@@ -852,7 +946,6 @@ function setSpriteMovement(spr, running, dir)
|
|||||||
|
|
||||||
GameState.prototype.check_input = function()
|
GameState.prototype.check_input = function()
|
||||||
{
|
{
|
||||||
|
|
||||||
player.body.velocity.x = 0;
|
player.body.velocity.x = 0;
|
||||||
player.body.velocity.y = 0;
|
player.body.velocity.y = 0;
|
||||||
velocityMod = 0;
|
velocityMod = 0;
|
||||||
@@ -873,10 +966,15 @@ GameState.prototype.check_input = function()
|
|||||||
GameState.prototype.update = function()
|
GameState.prototype.update = function()
|
||||||
{
|
{
|
||||||
this.check_input();
|
this.check_input();
|
||||||
|
|
||||||
|
for (var layer in this.map_collision_layers ) {
|
||||||
this.physics.arcade.collide(player, layer);
|
this.physics.arcade.collide(player, layer);
|
||||||
|
}
|
||||||
|
|
||||||
function _inner_collide(x) {
|
function _inner_collide(x) {
|
||||||
|
for ( var layer in this.map_collision_layers ) {
|
||||||
this.physics.arcade.collide(x, layer);
|
this.physics.arcade.collide(x, layer);
|
||||||
|
}
|
||||||
this.physics.arcade.collide(x, player);
|
this.physics.arcade.collide(x, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||