Add Krake boss with ink, pull marks and sweep tentacles plus boss mode

This commit is contained in:
2026-08-19 13:59:39 +02:00
parent 1a4cccda6e
commit 496c4af50e
12 changed files with 911 additions and 53 deletions
+18 -2
View File
@@ -30,6 +30,10 @@ export class Player {
onGround = true;
shieldHp = 0;
shieldTimer = 0;
slowTimer = 0;
slowFactor = 0.6;
pullTime = 0;
pullDir = new THREE.Vector3();
stats: PlayerStats = {
maxHealth: 100,
regen: 0,
@@ -50,6 +54,7 @@ export class Player {
private flashTime = 0;
private static readonly BASE_COLOR = 0x44aa44;
private static readonly HURT_COLOR = 0xff5555;
private static readonly SLOW_COLOR = 0x9944cc;
private static readonly HURT_FLASH_TIME = 0.3;
constructor() {
@@ -217,14 +222,23 @@ export class Player {
updateAnimations(dt: number) {
if (this.mixer) this.mixer.update(dt);
if (this.hurtCooldown > 0) this.hurtCooldown -= dt;
if (this.slowTimer > 0) this.slowTimer -= dt;
let color: THREE.Color;
if (this.flashTime > 0) {
this.flashTime -= dt;
const t = Math.max(0, this.flashTime) / Player.HURT_FLASH_TIME;
const color = new THREE.Color(Player.BASE_COLOR).lerp(
color = new THREE.Color(Player.BASE_COLOR).lerp(
new THREE.Color(Player.HURT_COLOR), t
);
for (const mat of this.bodyMaterials) mat.color.copy(color);
} else if (this.slowTimer > 0) {
color = new THREE.Color(Player.BASE_COLOR).lerp(
new THREE.Color(Player.SLOW_COLOR), 0.55
);
} else {
color = new THREE.Color(Player.BASE_COLOR);
}
for (const mat of this.bodyMaterials) mat.color.copy(color);
}
setGame(game: Game) {
@@ -316,6 +330,8 @@ export class Player {
this.health = 100;
this.shieldHp = 0;
this.shieldTimer = 0;
this.slowTimer = 0;
this.pullTime = 0;
this.body.position.set(0, 0.5, 0);
this.velocity.set(0, 0, 0);
this.jumpVelocity = 0;