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);
}
}
}