From 761c01f92fecd9d67fca2f8c503c54796349c397 Mon Sep 17 00:00:00 2001 From: Dorian Date: Mon, 9 Mar 2026 13:56:50 +0000 Subject: [PATCH] fix: reduce fighter sprite scale on mobile canvas On narrow viewports (<600px), fighters were oversized due to the desktop scale formula. Use reduced base (1.1) and tier (0.2) scale factors on mobile while keeping desktop unchanged. Co-Authored-By: Claude Opus 4.6 --- frontend/src/game/FightScene.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/game/FightScene.ts b/frontend/src/game/FightScene.ts index 9a3b09c..06ed023 100644 --- a/frontend/src/game/FightScene.ts +++ b/frontend/src/game/FightScene.ts @@ -468,10 +468,15 @@ export async function createFightScene(config: FightSceneConfig) { 'judge', ]) - const scaleA = (FIGHTER_BASE_SCALE + botA.tier * FIGHTER_TIER_SCALE) * SF + // On mobile (narrow canvas), reduce fighter size so they fit the viewport + const isMobileCanvas = W < 600 + const fBase = isMobileCanvas ? 1.1 : FIGHTER_BASE_SCALE + const fTier = isMobileCanvas ? 0.2 : FIGHTER_TIER_SCALE + + const scaleA = (fBase + botA.tier * fTier) * SF k.add([k.sprite('botA', { anim: 'idle' }), k.pos(-100, GROUND_Y - 6), k.anchor('bot'), k.scale(scaleA), k.z(10), k.opacity(0), 'fighterA']) - const scaleB = (FIGHTER_BASE_SCALE + botB.tier * FIGHTER_TIER_SCALE) * SF + const scaleB = (fBase + botB.tier * fTier) * SF k.add([k.sprite('botB', { anim: 'idle' }), k.pos(W + 100, GROUND_Y - 6), k.anchor('bot'), k.scale(-scaleB, scaleB), k.z(10), k.opacity(0), 'fighterB']) config.onReady?.()