Fix enemy facing direction and add player damage feedback

This commit is contained in:
2026-08-19 07:42:13 +02:00
parent 3fde0925c5
commit fd57ca9740
10 changed files with 169 additions and 33 deletions
+6 -6
View File
@@ -52,18 +52,18 @@ export class Frog extends Enemy {
// Belly
const belly = new THREE.Mesh(new THREE.SphereGeometry(0.4, 16, 12), this.whiteMat);
belly.scale.set(0.85, 0.5, 0.85);
belly.position.set(0, 0.3, -0.42);
belly.position.set(0, 0.3, 0.42);
this.registerFadeMesh(belly);
this.model.add(belly);
// Bulging eyes (face toward the player: -Z)
// Bulging eyes (face toward the player: +Z)
const eyeGeom = new THREE.SphereGeometry(0.17, 14, 12);
const pupilGeom = new THREE.SphereGeometry(0.08, 10, 8);
const pupilMat = new THREE.MeshToonMaterial({ color: 0x111122 });
this.eyeL = new THREE.Mesh(eyeGeom, this.whiteMat);
this.eyeR = new THREE.Mesh(eyeGeom, this.whiteMat);
this.eyeL.position.set(-0.24, 0.72, -0.28);
this.eyeR.position.set(0.24, 0.72, -0.28);
this.eyeL.position.set(-0.24, 0.72, 0.28);
this.eyeR.position.set(0.24, 0.72, 0.28);
this.eyeL.castShadow = true;
this.eyeR.castShadow = true;
this.registerFadeMesh(this.eyeL);
@@ -72,7 +72,7 @@ export class Frog extends Enemy {
for (const eye of [this.eyeL, this.eyeR]) {
const pupil = new THREE.Mesh(pupilGeom, pupilMat);
pupil.position.set(0, 0.02, -0.12);
pupil.position.set(0, 0.02, 0.12);
this.registerFadeMesh(pupil);
eye.add(pupil);
}
@@ -82,7 +82,7 @@ export class Frog extends Enemy {
for (const side of [-1, 1]) {
const thigh = new THREE.Mesh(legGeom, greenMat);
thigh.scale.set(0.8, 1, 1.2);
thigh.position.set(side * 0.42, 0.25, 0.35);
thigh.position.set(side * 0.42, 0.25, -0.35);
thigh.rotation.y = side * 0.5;
thigh.castShadow = true;
this.registerFadeMesh(thigh);