Improve map lock and smart heading behavior

This commit is contained in:
2026-03-25 14:56:28 +08:00
parent d1cc6cc473
commit a19342d61f
8 changed files with 300 additions and 62 deletions

View File

@@ -73,6 +73,12 @@ export class SoundDirector {
continue
}
if (effect.type === 'session_cancelled') {
this.stopGuidanceLoop()
this.play('control_completed:finish')
continue
}
if (effect.type === 'punch_feedback' && effect.tone === 'warning') {
this.play('punch_feedback:warning')
continue

View File

@@ -3,6 +3,7 @@ import { type GamePresentationState } from '../presentation/presentationState'
export type GameEffect =
| { type: 'session_started' }
| { type: 'session_cancelled' }
| { type: 'punch_feedback'; text: string; tone: 'neutral' | 'success' | 'warning' }
| { type: 'control_completed'; controlId: string; controlKind: 'start' | 'control' | 'finish'; sequence: number | null; label: string; displayTitle: string; displayBody: string }
| { type: 'guidance_state_changed'; guidanceState: GuidanceState; controlId: string | null }

View File

@@ -51,6 +51,11 @@ export class HapticsDirector {
continue
}
if (effect.type === 'session_cancelled') {
this.trigger('session_finished')
continue
}
if (effect.type === 'punch_feedback' && effect.tone === 'warning') {
this.trigger('punch_feedback:warning')
continue

View File

@@ -189,6 +189,10 @@ export class UiEffectDirector {
if (effect.type === 'session_finished') {
this.clearPunchButtonMotion()
}
if (effect.type === 'session_cancelled') {
this.clearPunchButtonMotion()
}
}
}
}