Guard native player health resolution

This commit is contained in:
Admin 2026-09-18 05:26:05 +00:00
parent ea12250556
commit 1e05b407a0

View File

@ -93,12 +93,16 @@ const webpDimensions = (name, dataUrl) => {
assert.fail(`${name} must expose VP8X dimensions`);
};
for (const [name, dataUrl] of Object.entries({ playerHealth, enemyHealth })) {
test(`${name} health sheet stays high resolution`, () => {
const { width, height } = webpDimensions(name, dataUrl);
assert.ok(width >= 1200, `${name} width must stay >= 1200px, got ${width}px`);
assert.ok(height >= 300, `${name} height must stay >= 300px, got ${height}px`);
assert.ok(width / 4 >= 300, `${name} frame width must stay >= 300px`);
assert.ok(height / 3 >= 100, `${name} frame height must stay >= 100px`);
});
}
test('playerHealth native frame stays high resolution', () => {
const { width, height } = webpDimensions('playerHealth', playerHealth);
assert.ok(width >= 300, `playerHealth width must stay >= 300px, got ${width}px`);
assert.ok(height >= 100, `playerHealth height must stay >= 100px, got ${height}px`);
});
test('enemyHealth health sheet stays high resolution', () => {
const { width, height } = webpDimensions('enemyHealth', enemyHealth);
assert.ok(width >= 1200, `enemyHealth width must stay >= 1200px, got ${width}px`);
assert.ok(height >= 300, `enemyHealth height must stay >= 300px, got ${height}px`);
assert.ok(width / 4 >= 300, 'enemyHealth frame width must stay >= 300px');
assert.ok(height / 3 >= 100, 'enemyHealth frame height must stay >= 100px');
});