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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,18 @@ class PreloadScene extends Phaser.Scene {
|
||||
this.load.image('fence', 'assets/fence.png');
|
||||
this.load.image('gravestone', 'assets/gravestone.png');
|
||||
|
||||
// City content assets
|
||||
this.load.image('chest', 'assets/chest.png');
|
||||
this.load.image('spawner', 'assets/spawner.png');
|
||||
this.load.image('signpost_city', 'assets/signpost_city.png');
|
||||
this.load.image('signpost_farm', 'assets/signpost_farm.png');
|
||||
this.load.image('signpost_both', 'assets/signpost_both.png');
|
||||
this.load.image('city_wall', 'assets/city_wall.png');
|
||||
this.load.image('road_tile', 'assets/road_tile.png');
|
||||
this.load.image('farm_zone', 'assets/farm_zone.png');
|
||||
this.load.image('fence_full', 'assets/fence_full.png');
|
||||
this.load.image('wall_damaged', 'assets/wall_damaged.png');
|
||||
|
||||
// Voxel stil asset-i (2.5D)
|
||||
this.load.image('tree_voxel_green', 'assets/tree_voxel_green.png');
|
||||
this.load.image('tree_voxel_blue', 'assets/tree_voxel_blue.png');
|
||||
@@ -130,6 +142,12 @@ class PreloadScene extends Phaser.Scene {
|
||||
'hill_sprite',
|
||||
'fence',
|
||||
'gravestone',
|
||||
// City content
|
||||
'chest',
|
||||
'spawner',
|
||||
'signpost_city',
|
||||
'signpost_farm',
|
||||
'signpost_both',
|
||||
// Voxel stil
|
||||
'tree_voxel_green',
|
||||
'tree_voxel_blue',
|
||||
|
||||
Reference in New Issue
Block a user