fea: 优化死亡特效
This commit is contained in:
1 parent
afe2f64b9b
commit
e7200989ab
9 files changed
+373
-94
No files matched your search
+8
-3
@@ -51,7 +51,7 @@ for (const d of LEVELS) {
|
||||
}
|
||||
function G_DEATHS() { return ''; }
|
||||
|
||||
console.log('\n=== 死亡与重生 ===');
|
||||
console.log('\n=== 死亡与手动重生 ===');
|
||||
{
|
||||
const L = new Level(LEVELS.find(l => l.id === 'j1'));
|
||||
const P = new Player(L);
|
||||
@@ -59,9 +59,14 @@ console.log('\n=== 死亡与重生 ===');
|
||||
P.onDeath = () => deaths++;
|
||||
for (let i = 0; i < 30; i++) { L.update(1, P, null); P.update(1); Input.endFrame(); }
|
||||
P.kill();
|
||||
// 新语义(2026-10-24):死亡后不自动重生,定格等待玩家手动按重生键
|
||||
for (let i = 0; i < 80; i++) { L.update(1, P, null); P.update(1); Input.endFrame(); }
|
||||
console.log(` 死亡计数=${deaths} 重生后 alive=${P.alive} 位置=(${P.x.toFixed(0)},${P.y.toFixed(0)})`);
|
||||
if (!P.alive) err('死亡后未复活');
|
||||
if (P.alive) err('死亡后未等待手动重生(自动复活了)');
|
||||
else console.log(` 死亡计数=${deaths} 80帧后仍定格等待手动重生 ✓(deadT=${P.deadT})`);
|
||||
P.respawn();
|
||||
for (let i = 0; i < 10; i++) { L.update(1, P, null); P.update(1); Input.endFrame(); }
|
||||
if (!P.alive) err('手动重生失败');
|
||||
else console.log(` 手动重生后 alive ✓ 位置=(${P.x.toFixed(0)},${P.y.toFixed(0)})`);
|
||||
if (deaths !== 1) err('死亡回调未触发');
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user