deploy: update image to latest

This commit is contained in:
Thomas Richter
2026-02-05 19:33:30 +01:00
parent 2ad205d495
commit 077e58216c

View File

@@ -140,13 +140,50 @@ export default class DeepSeaHuntingScene extends Phaser.Scene {
ease: 'Sine.inOut' ease: 'Sine.inOut'
}); });
// Move whale from entry to exit over 15 seconds // Create curved path from entry to exit
const path = new Phaser.Curves.Path(entry.x, entry.y);
// Calculate midpoint and perpendicular offset for curve
const midX = (entry.x + exit.x) / 2;
const midY = (entry.y + exit.y) / 2;
// Create perpendicular offset for natural swimming curve
const dx = exit.x - entry.x;
const dy = exit.y - entry.y;
const dist = Math.sqrt(dx * dx + dy * dy);
// Perpendicular direction (normalized)
const perpX = -dy / dist;
const perpY = dx / dist;
// Random curve amplitude (positive or negative for variety)
const curveAmount = (Math.random() > 0.5 ? 1 : -1) * (80 + Math.random() * 120);
// Control points for smooth S-curve
const ctrl1X = entry.x + dx * 0.25 + perpX * curveAmount;
const ctrl1Y = entry.y + dy * 0.25 + perpY * curveAmount;
const ctrl2X = entry.x + dx * 0.75 - perpX * curveAmount * 0.7;
const ctrl2Y = entry.y + dy * 0.75 - perpY * curveAmount * 0.7;
// Add cubic bezier curve
path.cubicBezierTo(exit.x, exit.y, ctrl1X, ctrl1Y, ctrl2X, ctrl2Y);
// Store path progress
const pathData = { t: 0 };
// Animate along curved path
this.tweens.add({ this.tweens.add({
targets: whale, targets: pathData,
x: exit.x, t: 1,
y: exit.y,
duration: 15000, duration: 15000,
ease: 'Sine.inOut', ease: 'Sine.inOut',
onUpdate: () => {
const point = path.getPoint(pathData.t);
const tangent = path.getTangent(pathData.t);
whale.setPosition(point.x, point.y);
whale.setRotation(Math.atan2(tangent.y, tangent.x));
},
onComplete: () => { onComplete: () => {
this.onWhaleExit(whale); this.onWhaleExit(whale);
} }