Phase 7: World Structure (New Direction)

This commit is contained in:
2025-12-08 10:56:47 +01:00
parent b79b70dcc1
commit b750f320fc
7 changed files with 491 additions and 10 deletions

View File

@@ -171,6 +171,42 @@ class GameScene extends Phaser.Scene {
const scooter = new Scooter(this, 25, 25);
this.vehicles.push(scooter);
// ZOMBIE SPAWNERS (City area)
console.log('👹 Creating Zombie Spawners...');
this.spawners = [];
// City spawners (3 spawners around city)
this.spawners.push(new ZombieSpawner(this, 55, 55, 5, 2, 25000)); // NW
this.spawners.push(new ZombieSpawner(this, 75, 55, 5, 2, 25000)); // NE
this.spawners.push(new ZombieSpawner(this, 65, 75, 5, 3, 20000)); // South (more zombies, faster)
// LOOT CHESTS
console.log('📦 Placing Loot Chests...');
this.chests = [];
// Farm Starter Chest (near spawn)
this.chests.push(new LootChest(this, 28, 28, 'farm_starter'));
// City Chests (3 chests in city)
this.chests.push(new LootChest(this, 60, 60, 'city'));
this.chests.push(new LootChest(this, 70, 60, 'city'));
this.chests.push(new LootChest(this, 65, 70, 'elite'));
// SIGNPOSTS/NAVIGATION
console.log('🪧 Adding Signposts...');
this.signposts = [];
// Path markers (using fence sprites as signposts)
const pathMarkers = [
{ x: 35, y: 35, label: '→ City' },
{ x: 50, y: 50, label: '← Farm' },
];
for (const marker of pathMarkers) {
this.terrainSystem.addDecoration(marker.x, marker.y, 'fence');
this.signposts.push({ gridX: marker.x, gridY: marker.y, label: marker.label });
}
// Kamera sledi igralcu z gladko interpolacijo (lerp 0.1)
this.cameras.main.startFollow(this.player.sprite, true, 0.1, 0.1);
@@ -353,6 +389,13 @@ class GameScene extends Phaser.Scene {
}
}
// Spawners Update
if (this.spawners) {
for (const spawner of this.spawners) {
if (spawner.update) spawner.update(delta);
}
}
// Parallax
if (this.parallaxSystem && this.player) {
const playerPos = this.player.getPosition();