Update dungeon map to include boss tileset and related logic
- Added boss-tiles.png and boss-tiles.psd files for new boss tileset - Updated NNDungeon.json to include boss tileset configuration - Modified main.js to comment out MenuScene and Gulch, keeping NNDungeon - Updated NNDungeon.js to: * Load boss-tiles spritesheet * Adjust player starting position * Update enemy creation logic to use boss-tiles when gid > 300 * Added special handling for NNBoss property These changes prepare the game for implementing boss characters using the new tileset.
This commit is contained in:
parent
a57c8a0334
commit
6507bda4d1
|
|
@ -781,8 +781,41 @@
|
||||||
"type":"",
|
"type":"",
|
||||||
"visible":true,
|
"visible":true,
|
||||||
"width":100,
|
"width":100,
|
||||||
"x":4500,
|
"x":6050.49833041819,
|
||||||
"y":300
|
"y":346.500238511687
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gid":301,
|
||||||
|
"height":200,
|
||||||
|
"id":22,
|
||||||
|
"name":"",
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"NNBoss",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"garbage",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"health",
|
||||||
|
"type":"int",
|
||||||
|
"value":3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"patrolY",
|
||||||
|
"type":"int",
|
||||||
|
"value":400
|
||||||
|
}],
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":200,
|
||||||
|
"x":4400,
|
||||||
|
"y":400
|
||||||
}],
|
}],
|
||||||
"opacity":1,
|
"opacity":1,
|
||||||
"type":"objectgroup",
|
"type":"objectgroup",
|
||||||
|
|
@ -848,7 +881,7 @@
|
||||||
"y":0
|
"y":0
|
||||||
}],
|
}],
|
||||||
"nextlayerid":6,
|
"nextlayerid":6,
|
||||||
"nextobjectid":22,
|
"nextobjectid":23,
|
||||||
"orientation":"orthogonal",
|
"orientation":"orthogonal",
|
||||||
"renderorder":"right-down",
|
"renderorder":"right-down",
|
||||||
"tiledversion":"1.11.2",
|
"tiledversion":"1.11.2",
|
||||||
|
|
@ -1554,6 +1587,19 @@
|
||||||
"tilecount":100,
|
"tilecount":100,
|
||||||
"tileheight":100,
|
"tileheight":100,
|
||||||
"tilewidth":100
|
"tilewidth":100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"columns":5,
|
||||||
|
"firstgid":301,
|
||||||
|
"image":"boss-tiles.png",
|
||||||
|
"imageheight":1000,
|
||||||
|
"imagewidth":1000,
|
||||||
|
"margin":0,
|
||||||
|
"name":"boss-tiles",
|
||||||
|
"spacing":0,
|
||||||
|
"tilecount":25,
|
||||||
|
"tileheight":200,
|
||||||
|
"tilewidth":200
|
||||||
}],
|
}],
|
||||||
"tilewidth":100,
|
"tilewidth":100,
|
||||||
"type":"map",
|
"type":"map",
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 278 KiB |
Binary file not shown.
|
|
@ -21,8 +21,8 @@ const config = {
|
||||||
|
|
||||||
},
|
},
|
||||||
scene: [
|
scene: [
|
||||||
MenuScene,
|
//MenuScene,
|
||||||
Gulch,
|
//Gulch,
|
||||||
NNDungeon
|
NNDungeon
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ export class NNDungeon extends Phaser.Scene {
|
||||||
frameWidth: 100,
|
frameWidth: 100,
|
||||||
frameHeight: 100
|
frameHeight: 100
|
||||||
});
|
});
|
||||||
|
this.load.spritesheet('boss-tiles', 'assets/boss-tiles.png', {
|
||||||
|
frameWidth: 100,
|
||||||
|
frameHeight: 100
|
||||||
|
});
|
||||||
this.load.spritesheet('99Dungeon-tiles', 'assets/dungeon-tiles.png', {
|
this.load.spritesheet('99Dungeon-tiles', 'assets/dungeon-tiles.png', {
|
||||||
frameWidth: 100,
|
frameWidth: 100,
|
||||||
frameHeight: 100
|
frameHeight: 100
|
||||||
|
|
@ -58,8 +62,8 @@ export class NNDungeon extends Phaser.Scene {
|
||||||
//const zoneLayer = gulchMap.getObjectLayer('zone');
|
//const zoneLayer = gulchMap.getObjectLayer('zone');
|
||||||
|
|
||||||
// Add a player
|
// Add a player
|
||||||
this.player = new Player(this, 2400, 3450);
|
//this.player = new Player(this, 2400, 3450);
|
||||||
//this.player = new Player(this, 3550, 350);
|
this.player = new Player(this, 3550, 350);
|
||||||
this.player.healthBars(true, 1, 3);
|
this.player.healthBars(true, 1, 3);
|
||||||
|
|
||||||
// zoneLayer.objects.forEach(object => {
|
// zoneLayer.objects.forEach(object => {
|
||||||
|
|
@ -90,7 +94,12 @@ export class NNDungeon extends Phaser.Scene {
|
||||||
runChildUpdate: true
|
runChildUpdate: true
|
||||||
});
|
});
|
||||||
enemiesLayer.objects.forEach(object => {
|
enemiesLayer.objects.forEach(object => {
|
||||||
let a99Boy = this.enemies.create(object.x-50, object.y-50, '99boy-tiles', object.gid-201);
|
let a99Boy;
|
||||||
|
if (object.gid > 300) {
|
||||||
|
a99Boy = this.enemies.create(object.x-50, object.y-50, 'boss-tiles', object.gid-301);
|
||||||
|
} else {
|
||||||
|
a99Boy = this.enemies.create(object.x-50, object.y-50, '99boy-tiles', object.gid-201);
|
||||||
|
}
|
||||||
if (object.properties) {
|
if (object.properties) {
|
||||||
object.properties.forEach(prop => {
|
object.properties.forEach(prop => {
|
||||||
if (prop.name === 'patrolX') {
|
if (prop.name === 'patrolX') {
|
||||||
|
|
@ -124,7 +133,7 @@ export class NNDungeon extends Phaser.Scene {
|
||||||
a99Boy.bottleReloadVariance = 500;
|
a99Boy.bottleReloadVariance = 500;
|
||||||
}
|
}
|
||||||
if (prop.name === 'NNBoss' && prop.value === true) {
|
if (prop.name === 'NNBoss' && prop.value === true) {
|
||||||
a99Boy.setScale(2.5);
|
a99Boy.tiles = 'boss-tiles'
|
||||||
}
|
}
|
||||||
if (prop.name === 'health') {
|
if (prop.name === 'health') {
|
||||||
a99Boy.health = prop.value;
|
a99Boy.health = prop.value;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ export class Gulch extends Phaser.Scene {
|
||||||
runChildUpdate: true
|
runChildUpdate: true
|
||||||
});
|
});
|
||||||
enemiesLayer.objects.forEach(object => {
|
enemiesLayer.objects.forEach(object => {
|
||||||
let a99Boy = this.enemies.create(object.x-50, object.y-50, '99boy-tiles', object.gid-101);
|
|
||||||
if (object.properties) {
|
if (object.properties) {
|
||||||
object.properties.forEach(prop => {
|
object.properties.forEach(prop => {
|
||||||
if (prop.name === 'patrolX') {
|
if (prop.name === 'patrolX') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue