feat: Enhance level 1 with expanded map size, updated tile data, improved enemy spawning, refined UI interactions and adjusted wave configurations
- Expanded level 1 map from 9x16 to 13x16 tiles with updated collision data - Modified enemy spawn timing ranges for more varied gameplay - Adjusted interface animations and tower placement logic - Updated wave configurations including new wave 3 with increased difficulty - Disabled zoom controls and removed right-click tower deletion functionality The changes aim to provide a larger playable area, improve game balance through better enemy distribution, enhance user interface responsiveness, and increase challenge progression across waves.
This commit is contained in:
parent
1233c2bf76
commit
aa8cabc90f
|
|
@ -1,73 +1,49 @@
|
|||
{ "compressionlevel":-1,
|
||||
"height":9,
|
||||
"infinite":true,
|
||||
"height":13,
|
||||
"infinite":false,
|
||||
"layers":[
|
||||
{
|
||||
"chunks":[
|
||||
{
|
||||
"data":[2, 1, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 1, 2, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 1, 1, 1, 2, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 2, 2, 2, 2, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"height":16,
|
||||
"data":[2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 0, 0,
|
||||
2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 12, 0, 0,
|
||||
2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 12, 0, 0,
|
||||
2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 12, 0, 0,
|
||||
2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 12, 0, 0,
|
||||
2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 12, 0, 0,
|
||||
2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 12, 0, 0,
|
||||
2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 12, 0, 0,
|
||||
2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 12, 0, 0,
|
||||
2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 12, 0, 0,
|
||||
2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 0, 0,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 0, 0,
|
||||
2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 2684354572, 0, 0],
|
||||
"height":13,
|
||||
"id":1,
|
||||
"name":"main",
|
||||
"opacity":1,
|
||||
"startx":0,
|
||||
"starty":0,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"chunks":[
|
||||
{
|
||||
"data":[0, 0, 16, 0, 16, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 16, 16, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 16, 16, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 0, 16, 0, 0, 0, 0, 16, 0, 16, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 16, 16, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"height":16,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"height":16,
|
||||
"height":13,
|
||||
"id":2,
|
||||
"name":"platforms",
|
||||
"opacity":1,
|
||||
"startx":0,
|
||||
"starty":0,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 360 KiB |
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.11.2" orientation="orthogonal" renderorder="right-down" width="16" height="9" tilewidth="200" tileheight="200" infinite="1" nextlayerid="3" nextobjectid="1">
|
||||
<map version="1.10" tiledversion="1.11.2" orientation="orthogonal" renderorder="right-down" width="16" height="13" tilewidth="200" tileheight="200" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<editorsettings>
|
||||
<export target="../level1.json" format="json"/>
|
||||
</editorsettings>
|
||||
|
|
@ -11,48 +11,38 @@
|
|||
</properties>
|
||||
</tile>
|
||||
</tileset>
|
||||
<layer id="1" name="main" width="16" height="9">
|
||||
<layer id="1" name="main" width="16" height="13">
|
||||
<data encoding="csv">
|
||||
<chunk x="0" y="0" width="16" height="16">
|
||||
2,1,2,2,2,2,2,2,0,0,0,0,0,0,0,0,
|
||||
2,1,2,1,1,1,2,2,0,0,0,0,0,0,0,0,
|
||||
2,1,1,1,2,1,1,2,0,0,0,0,0,0,0,0,
|
||||
2,2,2,2,2,2,1,2,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
2,1,2,2,2,2,2,2,2,2,2,2,2,12,0,0,
|
||||
2,1,2,1,1,1,2,2,2,2,2,2,2,12,0,0,
|
||||
2,1,1,1,2,1,1,2,2,1,1,1,2,12,0,0,
|
||||
2,2,2,2,2,2,1,2,2,1,2,2,2,12,0,0,
|
||||
2,2,2,2,2,2,1,2,2,1,2,2,2,12,0,0,
|
||||
2,1,1,1,1,1,1,2,2,1,1,1,2,12,0,0,
|
||||
2,1,2,2,2,2,2,2,2,2,2,1,2,12,0,0,
|
||||
2,1,2,1,1,1,1,2,2,2,2,1,2,12,0,0,
|
||||
2,1,2,1,2,2,1,1,2,2,2,1,2,12,0,0,
|
||||
2,1,2,1,2,2,2,1,1,1,1,1,2,12,0,0,
|
||||
2,1,1,1,2,2,2,2,2,2,2,2,2,12,0,0,
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,12,0,0,
|
||||
2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,2684354572,0,0
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="2" name="platforms" width="16" height="9">
|
||||
<layer id="2" name="platforms" width="16" height="13">
|
||||
<data encoding="csv">
|
||||
<chunk x="0" y="0" width="16" height="16">
|
||||
0,0,16,0,16,0,16,0,0,0,0,0,0,0,0,0,
|
||||
0,0,16,0,0,0,16,0,0,0,0,0,0,0,0,0,
|
||||
0,0,16,0,0,0,16,0,0,0,16,0,0,0,0,0,
|
||||
16,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,16,16,0,16,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,16,16,0,16,0,0,0,16,0,0,0,0,0,0,0,
|
||||
0,0,0,16,0,0,0,0,0,0,16,16,0,0,0,0,
|
||||
0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,
|
||||
0,0,16,0,0,16,0,0,0,0,16,0,16,0,0,0,
|
||||
16,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,
|
||||
0,0,16,0,16,16,0,0,0,0,16,0,0,0,0,0,
|
||||
0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,16,0,0,16,0,0,0,0,
|
||||
0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
</data>
|
||||
</layer>
|
||||
</map>
|
||||
|
|
|
|||
|
|
@ -57,23 +57,23 @@ export class Level extends Phaser.Scene {
|
|||
}
|
||||
|
||||
addControls() {
|
||||
this.input.on('wheel', (pointer, gameObjects, deltaX, deltaY) => {
|
||||
const zoomSpeed = 0.1;
|
||||
if (deltaY < 0) {
|
||||
// Zoom in
|
||||
this.cameras.main.zoom += zoomSpeed;
|
||||
} else if (deltaY > 0) {
|
||||
// Zoom out
|
||||
this.cameras.main.zoom -= zoomSpeed;
|
||||
}
|
||||
// this.input.on('wheel', (pointer, gameObjects, deltaX, deltaY) => {
|
||||
// const zoomSpeed = 0.1;
|
||||
// if (deltaY < 0) {
|
||||
// // Zoom in
|
||||
// this.cameras.main.zoom += zoomSpeed;
|
||||
// } else if (deltaY > 0) {
|
||||
// // Zoom out
|
||||
// this.cameras.main.zoom -= zoomSpeed;
|
||||
// }
|
||||
|
||||
// Limit zoom range to prevent extreme zoom levels
|
||||
this.cameras.main.zoom = Phaser.Math.Clamp(this.cameras.main.zoom, 0.5, 2);
|
||||
// // Limit zoom range to prevent extreme zoom levels
|
||||
// this.cameras.main.zoom = Phaser.Math.Clamp(this.cameras.main.zoom, 0.5, 2);
|
||||
|
||||
// Zoom toward mouse position
|
||||
const worldPoint = this.input.activePointer.positionToCamera(this.cameras.main);
|
||||
this.cameras.main.centerOn(worldPoint.x, worldPoint.y);
|
||||
});
|
||||
// // Zoom toward mouse position
|
||||
// const worldPoint = this.input.activePointer.positionToCamera(this.cameras.main);
|
||||
// this.cameras.main.centerOn(worldPoint.x, worldPoint.y);
|
||||
// });
|
||||
|
||||
// Add camera panning functionality
|
||||
this.input.on('pointerdown', (pointer) => {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ export class Enemies {
|
|||
this.speedLow = ENEMIES_CONFIG[type].speedLow;
|
||||
this.speedHigh = ENEMIES_CONFIG[type].speedHigh;
|
||||
this.baseSprite = ENEMIES_CONFIG[type].spriteStart;
|
||||
this.spawnRange = {
|
||||
low: 500,
|
||||
high: 4000
|
||||
}
|
||||
|
||||
this.spawnEnemy();
|
||||
}
|
||||
|
|
@ -24,7 +28,7 @@ export class Enemies {
|
|||
const spawnY = (this.y * 200) + 100 + randY;
|
||||
|
||||
// Randomize Spawn Time a bit
|
||||
this.scene.time.delayedCall(Phaser.Math.Between(0,2000), () => {
|
||||
this.scene.time.delayedCall(Phaser.Math.Between(this.spawnRange.low, this.spawnRange.high), () => {
|
||||
// Create enemy and store reference
|
||||
const enemy = this.scene.add.sprite(spawnX, spawnY, ENEMIES_CONFIG[this.type].spriteSheet, ENEMIES_CONFIG[this.type].spriteStart);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export class InterfaceManager {
|
|||
|
||||
constructor(scene) {
|
||||
this.scene = scene;
|
||||
this.gold = 100;
|
||||
this.gold = 150;
|
||||
this.cores = 20;
|
||||
this.interfaceOpen = false;
|
||||
this.selectedTower = false;
|
||||
|
|
@ -56,15 +56,15 @@ export class InterfaceManager {
|
|||
this.scene.tweens.add({
|
||||
targets: this.intTop,
|
||||
y: 50,
|
||||
duration: 2000,
|
||||
delay: 2000,
|
||||
duration: 500,
|
||||
delay: 500,
|
||||
ease: 'Back.easeOut',
|
||||
onComplete: () => {
|
||||
this.scene.tweens.add({
|
||||
targets: [this.coreText, this.goldText, this.intCore],
|
||||
angle: 360,
|
||||
alpha: 1,
|
||||
duration: 1000,
|
||||
duration: 500,
|
||||
onComplete: () => {
|
||||
this.scene.tweens.add({
|
||||
targets: this.intCore,
|
||||
|
|
@ -103,14 +103,14 @@ export class InterfaceManager {
|
|||
this.scene.tweens.add({
|
||||
targets: this.intMain,
|
||||
y: 1150,
|
||||
duration: 2000,
|
||||
delay: 2000,
|
||||
duration: 500,
|
||||
delay: 500,
|
||||
ease: 'Back.easeOut',
|
||||
onComplete: () => {
|
||||
this.scene.tweens.add({
|
||||
targets: [this.interfaceText, this.upLeft, this.upRight],
|
||||
alpha: 1,
|
||||
duration: 1000,
|
||||
duration: 500,
|
||||
onComplete: () => {
|
||||
this.scene.tweens.add({
|
||||
targets: [this.upLeft, this.upRight],
|
||||
|
|
@ -266,7 +266,7 @@ export class InterfaceManager {
|
|||
.setOrigin(0.5)
|
||||
.setScrollFactor(0);
|
||||
slot.add(slotBack);
|
||||
slotBack.setInteractive();
|
||||
//slotBack.setInteractive();
|
||||
slotBack.on('pointerdown', () => {
|
||||
this.selectTower(type);
|
||||
});
|
||||
|
|
@ -384,9 +384,10 @@ export class InterfaceManager {
|
|||
}
|
||||
|
||||
// Snap to current mouse position
|
||||
const levelCam = this.scene.levelScene.cameras.main;
|
||||
const mouse = this.scene.input.activePointer;
|
||||
const worldX = mouse.worldX;
|
||||
const worldY = mouse.worldY;
|
||||
const worldX = mouse.position.x + levelCam.scrollX;
|
||||
const worldY = mouse.position.y + levelCam.scrollY;
|
||||
|
||||
// Convert world coordinates to tile coordinates
|
||||
const tileX = Math.floor(worldX / 200); // Assuming 200px tile width
|
||||
|
|
@ -405,9 +406,10 @@ export class InterfaceManager {
|
|||
update(time, delta) {
|
||||
if (this.selectedTower) {
|
||||
// Snap to current mouse position
|
||||
const levelCam = this.scene.levelScene.cameras.main;
|
||||
const mouse = this.scene.input.activePointer;
|
||||
const worldX = mouse.worldX;
|
||||
const worldY = mouse.worldY;
|
||||
const worldX = mouse.position.x + levelCam.scrollX;
|
||||
const worldY = mouse.position.y + levelCam.scrollY;
|
||||
|
||||
// Convert world coordinates to tile coordinates
|
||||
const tileX = Math.floor(worldX / 200); // Assuming 200px tile width
|
||||
|
|
@ -418,9 +420,10 @@ export class InterfaceManager {
|
|||
x: tileX,
|
||||
y: tileY
|
||||
};
|
||||
|
||||
// Convert back to world position for proper snapping
|
||||
const snappedX = tileX * 200 + 100; // Center the tower on the tile (assuming 200px tiles)
|
||||
const snappedY = tileY * 200 + 100;
|
||||
const snappedX = tileX * 200 + 100 - levelCam.scrollX; // Center the tower on the tile (assuming 200px tiles)
|
||||
const snappedY = tileY * 200 + 100 - levelCam.scrollY;
|
||||
|
||||
this.selectedTower.setPosition(snappedX, snappedY);
|
||||
|
||||
|
|
@ -444,11 +447,6 @@ export class InterfaceManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mouse.rightButtonDown()) {
|
||||
this.selectedTower.destroy();
|
||||
this.selectedTower = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,8 +4,8 @@ export const WAVE_CONFIG = {
|
|||
//Spawn Point
|
||||
spawnX: 1,
|
||||
spawnY: 0,
|
||||
endX: 6,
|
||||
endY: 3,
|
||||
endX: 11,
|
||||
endY: 2,
|
||||
// Wave
|
||||
1: {
|
||||
// Schedule
|
||||
|
|
@ -40,6 +40,22 @@ export const WAVE_CONFIG = {
|
|||
basic1: 5,
|
||||
basic2: 4
|
||||
}
|
||||
},
|
||||
// Wave
|
||||
3: {
|
||||
// Schedule
|
||||
1: {
|
||||
begin: 0,
|
||||
basic2: 5
|
||||
},
|
||||
2: {
|
||||
begin: 15,
|
||||
basic2: 6
|
||||
},
|
||||
3: {
|
||||
begin: 30,
|
||||
basic2: 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ export class WaveManager {
|
|||
this.waveTimer += delta;
|
||||
|
||||
if (this.waveTimer >= this.waveStart && this.levelActive === true && this.waveActive===true) {
|
||||
console.log('Wave',this.wave,'Schedule',this.schedule);
|
||||
//console.log('Wave',this.wave,'Schedule',this.schedule);
|
||||
// Make path synchronous
|
||||
this.makePath().then(() => {
|
||||
// Spawn enemies after path is ready
|
||||
|
|
@ -172,13 +172,13 @@ export class WaveManager {
|
|||
|
||||
spawnSchedule() {
|
||||
if (this.scheduleInfo.hasOwnProperty('basic1')) {
|
||||
console.log('Spawn',this.scheduleInfo.basic1,'Basic1 enemies');
|
||||
//console.log('Spawn',this.scheduleInfo.basic1,'Basic1 enemies');
|
||||
for (let e = 0; e < this.scheduleInfo.basic1; e++) {
|
||||
const enemy = new Enemies(this.scene, 'basic1', this.spawnX, this.spawnY, this.path);
|
||||
}
|
||||
}
|
||||
if (this.scheduleInfo.hasOwnProperty('basic2')) {
|
||||
console.log('Spawn',this.scheduleInfo.basic2,'Basic2 enemies');
|
||||
//console.log('Spawn',this.scheduleInfo.basic2,'Basic2 enemies');
|
||||
for (let e = 0; e < this.scheduleInfo.basic2; e++) {
|
||||
const enemy = new Enemies(this.scene, 'basic2', this.spawnX, this.spawnY, this.path);
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ export class WaveManager {
|
|||
const width = this.scene.levelMap.width;
|
||||
const height = this.scene.levelMap.height;
|
||||
const grid = [];
|
||||
|
||||
console.log('width', width, 'height', height);
|
||||
// Create a grid based on collision data
|
||||
for (let y = 0; y < height; y++) {
|
||||
grid[y] = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue