Add wave configuration for new wave 5 with updated path threshold logic
This commit introduces a new wave configuration (wave 5) with its schedule segments and enemy properties. It also adjusts the path threshold calculation in WaveManager to improve enemy movement accuracy when reaching waypoints.
This commit is contained in:
parent
91a5919fe4
commit
603cf47348
|
|
@ -64,7 +64,7 @@ export const WAVE_CONFIG = {
|
||||||
1: {
|
1: {
|
||||||
begin: 0,
|
begin: 0,
|
||||||
basic1: 10,
|
basic1: 10,
|
||||||
basic3: 2
|
basic3: 2,
|
||||||
},
|
},
|
||||||
2: {
|
2: {
|
||||||
begin: 15,
|
begin: 15,
|
||||||
|
|
@ -76,6 +76,28 @@ export const WAVE_CONFIG = {
|
||||||
begin: 30,
|
begin: 30,
|
||||||
basic3: 4
|
basic3: 4
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
//Wave
|
||||||
|
5: {
|
||||||
|
//Schedule
|
||||||
|
1: {
|
||||||
|
begin: 0,
|
||||||
|
advanced1: 1,
|
||||||
|
},
|
||||||
|
2: {
|
||||||
|
begin: 20,
|
||||||
|
basic1: 8,
|
||||||
|
basic2: 3,
|
||||||
|
basic3: 2
|
||||||
|
},
|
||||||
|
3: {
|
||||||
|
begin: 35,
|
||||||
|
basic1: 15
|
||||||
|
},
|
||||||
|
4: {
|
||||||
|
begin: 40,
|
||||||
|
advanced2: 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@ export class WaveManager {
|
||||||
Math.pow(enemy.y - this.scene.gridToLocation(nextPoint.y, offsetY), 2)
|
Math.pow(enemy.y - this.scene.gridToLocation(nextPoint.y, offsetY), 2)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (distToNextPoint < segmentSpeed * 0.5) { // Threshold for reaching point
|
if (distToNextPoint < segmentSpeed * 0.2) { // Threshold for reaching point
|
||||||
enemy.props.pathPhase++; // Move to next path segment
|
enemy.props.pathPhase++; // Move to next path segment
|
||||||
|
|
||||||
// If we've reached the end of the path, remove the enemy or handle accordingly
|
// If we've reached the end of the path, remove the enemy or handle accordingly
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue