popraven novi npc

This commit is contained in:
2025-12-08 17:09:52 +01:00
parent 81a7895c10
commit abc536fea1
17 changed files with 149 additions and 58 deletions

View File

@@ -164,18 +164,17 @@ class OceanSystem {
this.oxygen += (this.oxygenRegenRate * delta) / 1000;
if (this.oxygen > this.maxOxygen) this.oxygen = this.maxOxygen;
}
updateBoatVisuals() {
if (this.isBoating && this.currentBoat && this.scene.player) {
this.currentBoat.x = this.scene.player.sprite.x;
this.currentBoat.y = this.scene.player.sprite.y + 10; // Slightly below
this.currentBoat.setDepth(this.scene.player.sprite.depth - 1);
}
// Flip based on movement?
// Access input vector or previous pos?
// Simplified:
if (this.scene.input.keyboard.checkDown(this.scene.input.keyboard.addKey('A'), 100)) this.currentBoat.setFlipX(false);
if (this.scene.input.keyboard.checkDown(this.scene.input.keyboard.addKey('D'), 100)) this.currentBoat.setFlipX(true);
}
updateBoatVisuals() {
if (this.isBoating && this.currentBoat && this.scene.player) {
this.currentBoat.x = this.scene.player.sprite.x;
this.currentBoat.y = this.scene.player.sprite.y + 10; // Slightly below
this.currentBoat.setDepth(this.scene.player.sprite.depth - 1);
// Flip based on movement
if (this.scene.input.keyboard.checkDown(this.scene.input.keyboard.addKey('A'), 100)) this.currentBoat.setFlipX(false);
if (this.scene.input.keyboard.checkDown(this.scene.input.keyboard.addKey('D'), 100)) this.currentBoat.setFlipX(true);
}
}
}

View File

@@ -935,7 +935,7 @@ class TerrainSystem {
if (type === 'ruin' && !this.scene.textures.exists('ruin')) {
TextureGenerator.createStructureSprite(this.scene, 'ruin', 'ruin');
}
if (type === 'arena' && !this.scene.exists('arena')) {
if (type === 'arena' && !this.scene.textures.exists('arena')) {
// Arena uses ruin texture for now
TextureGenerator.createStructureSprite(this.scene, 'arena', 'ruin');
}

View File

@@ -18,6 +18,12 @@ class WeatherSystem {
this.currentSeason = 'spring';
this.daysPerSeason = 7; // Vsak letni čas traja 7 dni
// --- TEMPERATURE System ---
this.baseTemp = 20; // Celsius
this.currentTemp = 20;
this.tempCheckTimer = 0;
this.tempDamageInterval = 5000; // Damage every 5 seconds
// --- State ---
this.currentPhase = 'day';
@@ -44,6 +50,9 @@ class WeatherSystem {
// 2. Update Weather Logic (Durations, Changes)
this.updateWeatherLogic(delta);
// 2.5. Update Temperature System
this.updateTemperature(delta);
// 3. Update Physics (Rain drops)
this.updateWeatherPhysics(delta);