popravki
This commit is contained in:
@@ -102,6 +102,21 @@ class GameScene extends Phaser.Scene {
|
||||
this.terrainSystem.placeStructure(65, 64, 'signpost_farm'); // Pri mestu "← Farm"
|
||||
this.terrainSystem.placeStructure(45, 40, 'signpost_both'); // Na križišču
|
||||
|
||||
// DAMAGED CITY WALLS - vizualni markerji mesta (porušeni zidovi)
|
||||
console.log('🏚️ Placing Damaged City Walls...');
|
||||
// Delno porušeni zidovi okoli city perimetra
|
||||
const wallPositions = [
|
||||
[65, 65], [70, 65], [75, 65], // Top wall
|
||||
[65, 79], [70, 79], [75, 79], // Bottom wall
|
||||
[65, 70], [65, 75], // Left wall
|
||||
[79, 70], [79, 75] // Right wall
|
||||
];
|
||||
wallPositions.forEach(([wx, wy]) => {
|
||||
if (Math.random() < 0.7) { // 70% chance per segment (gaps for realism)
|
||||
this.terrainSystem.placeStructure(wx, wy, 'wall_damaged');
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize Pathfinding (Worker)
|
||||
console.log('🗺️ Initializing Pathfinding...');
|
||||
this.pathfinding = new PathfindingSystem(this);
|
||||
@@ -358,6 +373,9 @@ class GameScene extends Phaser.Scene {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Run Antigravity Engine Update
|
||||
this.Antigravity_Update(delta);
|
||||
}
|
||||
|
||||
spawnNightZombie() {
|
||||
@@ -464,19 +482,40 @@ class GameScene extends Phaser.Scene {
|
||||
// 2. Place starter resources (chest s semeni)
|
||||
this.terrainSystem.placeStructure(farmX + 3, farmY + 3, 'chest');
|
||||
|
||||
// 3. Place fence around farm (optional)
|
||||
const fencePositions = [
|
||||
[farmX - farmRadius, farmY - farmRadius],
|
||||
[farmX + farmRadius, farmY - farmRadius],
|
||||
[farmX - farmRadius, farmY + farmRadius],
|
||||
[farmX + farmRadius, farmY + farmRadius]
|
||||
];
|
||||
fencePositions.forEach(([fx, fy]) => {
|
||||
if (fx >= 0 && fx < 100 && fy >= 0 && fy < 100) {
|
||||
this.terrainSystem.placeStructure(fx, fy, 'fence');
|
||||
// 3. Place FULL FENCE around farm
|
||||
console.log('🚧 Building Farm Fence...');
|
||||
const minX = farmX - farmRadius;
|
||||
const maxX = farmX + farmRadius;
|
||||
const minY = farmY - farmRadius;
|
||||
const maxY = farmY + farmRadius;
|
||||
|
||||
// Top and bottom horizontal fences
|
||||
for (let x = minX; x <= maxX; x++) {
|
||||
if (x >= 0 && x < 100) {
|
||||
this.terrainSystem.placeStructure(x, minY, 'fence_full'); // Top
|
||||
this.terrainSystem.placeStructure(x, maxY, 'fence_full'); // Bottom
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Left and right vertical fences
|
||||
for (let y = minY; y <= maxY; y++) {
|
||||
if (y >= 0 && y < 100) {
|
||||
this.terrainSystem.placeStructure(minX, y, 'fence_full'); // Left
|
||||
this.terrainSystem.placeStructure(maxX, y, 'fence_full'); // Right
|
||||
}
|
||||
}
|
||||
|
||||
console.log('✅ Farm Area Initialized at (20,20)');
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
// ANTIGRAVITY ENGINE UPDATE
|
||||
// ========================================================
|
||||
|
||||
Antigravity_Update(delta) {
|
||||
// Globalni update klic
|
||||
if (window.Antigravity) {
|
||||
window.Antigravity.Update(this, delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user