feat: mobile UX polish with haptics and reduced motion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-09 00:23:39 +00:00
co-authored by Claude Opus 4.6
parent 8be71e9929
commit aca025a360
5 changed files with 61 additions and 4 deletions
+8 -1
View File
@@ -8,7 +8,7 @@ import { ARENA_THEMES, spriteAnims, CHALLENGE_THEMED, TIER_ULTIMATES, CREATOR_MO
import {
CREATOR_ULTIMATE_CHANCE, CREATOR_THEMED_MOVE_RATIO,
CRIT_THEMED_RATIO, CHOREOGRAPHY_THEMED_RATIO, CHOREOGRAPHY_GENERIC_CUTOFF,
TIER_ULTIMATE_CHANCES, isPerfMode, perfParticles,
TIER_ULTIMATE_CHANCES, isPerfMode, perfParticles, isReducedMotion, haptic,
} from './fight/config'
import { spawnSparks as _spawnSparks, spawnBulletHoles as _spawnBulletHoles, spawnExhaust as _spawnExhaust } from './fight/particles'
import { glitchRGB as _glitchRGB, scanlineGlitch as _scanlineGlitch, vhsTracking as _vhsTracking, dimensionalShift as _dimensionalShift } from './fight/effects'
@@ -168,6 +168,13 @@ export async function createFightScene(config: FightSceneConfig) {
texFilter: 'nearest',
})
// Wrap k.shake to support reduced motion + haptic feedback
const _origShake = k.shake.bind(k)
k.shake = ((intensity: number) => {
if (intensity >= 3) haptic(Math.min(100, intensity * 8))
if (!isReducedMotion()) _origShake(intensity)
}) as typeof k.shake
const colorsA = getBotColors(botA.seed)
const colorsB = getBotColors(botB.seed)