Test safe player hit FX wiring
This commit is contained in:
parent
f489a3d8f4
commit
481a83ca7c
@ -90,3 +90,12 @@ test('a hit frame emits a completion marker after the rest of scene update runs'
|
||||
assert.match(source, /const hadQueuedPlayerHit = this\.pendingPlayerHits\.length > 0/);
|
||||
assert.match(source, /this\.checkGameState\(\);[\s\S]*?combat:post-hit-frame-complete/);
|
||||
});
|
||||
|
||||
test('player hit FX runs after queued hit processing, outside the overlap callback', async () => {
|
||||
const source = await read('src/game-v4.js');
|
||||
|
||||
assert.match(source, /this\.pendingPlayerHits\.push\(\{[\s\S]*?x: shot\.x,[\s\S]*?y: shot\.y/);
|
||||
assert.match(source, /if \(result\.appliedHits > 0\) \{[\s\S]*?this\.spawnExplosion\(impact\.x, impact\.y, 0\.32\)/);
|
||||
assert.match(source, /this\.flashShip\(this\.player, 0xffcccc\)/);
|
||||
assert.match(source, /combat:player-hit-fx-error/);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user