Add Minotaurus boss with front armor, dash stun and jumpable axe swing

This commit is contained in:
2026-08-19 14:41:02 +02:00
parent 7d41f6db6c
commit 1f67aaa982
5 changed files with 943 additions and 9 deletions
+28
View File
@@ -34,6 +34,7 @@ export class Player {
slowFactor = 0.6;
pullTime = 0;
pullDir = new THREE.Vector3();
stunTime = 0;
stats: PlayerStats = {
maxHealth: 100,
regen: 0,
@@ -52,6 +53,7 @@ export class Player {
private bodyMaterials: THREE.MeshToonMaterial[] = [];
private hurtCooldown = 0;
private flashTime = 0;
private stunStars: THREE.Group;
private static readonly BASE_COLOR = 0x44aa44;
private static readonly HURT_COLOR = 0xff5555;
private static readonly SLOW_COLOR = 0x9944cc;
@@ -60,6 +62,19 @@ export class Player {
constructor() {
this.body = new THREE.Group();
// Stun-Sterne: kreisen um den Kopf, solange der Spieler gestunnt ist
this.stunStars = new THREE.Group();
const starGeom = new THREE.OctahedronGeometry(0.13);
const starMat = new THREE.MeshBasicMaterial({ color: 0xffdd33 });
for (let i = 0; i < 3; i++) {
const a = (i / 3) * Math.PI * 2;
const star = new THREE.Mesh(starGeom, starMat);
star.position.set(Math.cos(a) * 0.55, 1.35, Math.sin(a) * 0.55);
this.stunStars.add(star);
}
this.stunStars.visible = false;
this.body.add(this.stunStars);
// Helmet
const helmetGeom = new THREE.SphereGeometry(0.45, 8, 8, 0, Math.PI * 2, 0, Math.PI / 2);
const helmetMat = new THREE.MeshToonMaterial({ color: 0x888888 });
@@ -223,6 +238,18 @@ export class Player {
if (this.mixer) this.mixer.update(dt);
if (this.hurtCooldown > 0) this.hurtCooldown -= dt;
if (this.slowTimer > 0) this.slowTimer -= dt;
if (this.stunTime > 0) this.stunTime -= dt;
// Stun-Sterne animieren
this.stunStars.visible = this.stunTime > 0;
if (this.stunStars.visible) {
this.stunStars.rotation.y += dt * 5;
for (const star of this.stunStars.children) {
star.rotation.x += dt * 8;
star.rotation.y += dt * 6;
star.position.y = 1.35 + Math.sin(this.stunTime * 10) * 0.08;
}
}
let color: THREE.Color;
if (this.flashTime > 0) {
@@ -332,6 +359,7 @@ export class Player {
this.shieldTimer = 0;
this.slowTimer = 0;
this.pullTime = 0;
this.stunTime = 0;
this.body.position.set(0, 0.5, 0);
this.velocity.set(0, 0, 0);
this.jumpVelocity = 0;