Files
joke-app/apps/web/src/games/quoridor/sound.ts
EJClaw 8175cebd2c 체스·장기·쿼리도 소리·움직임, 장기 상차림 시간 무제한
- 체스: 기물이 출발 칸에서 미끄러져 와 내려앉음(내가 끌어다 놓은 수는 제외), 캐슬링은 룩도 같이, 잡힌 기물(앙파상 폰 포함) 사라짐, 체크 칸 빛·말풍선 튀어나옴, 마지막 수 칸 살짝 나타남
- 체스 소리: 나무 기물 톡, 잡기, 캐슬링, 승진, 체크, 체크메이트 순간, 무르기, 기물 집기, 안 되는 칸 (fx.ts 순수 함수 + 테스트)
- 장기: 묵직한 기물 미끄러짐·내려앉기, 잡힌 기물 사라짐, 장군 궁 자리 고동, 상차림 마·상 하나씩 튀어나옴
- 장기 소리: 두꺼운 나무 "딱", 잡기, 장군·멍군·빅장, 외통 순간, 한수쉼, 무르기, 상차림 놓기 (fx.ts + 테스트)
- 장기 상차림 고르는 시간에 무제한(0) 추가, 방 설정 "자세한 설정"에서 30초·1분·3분·무제한 (기본 1분 그대로), 무제한이면 상차림 시계 숨김, 끊긴 사람만 접속 유예 뒤 자동 선택
- 쿼리도: 말 한 칸은 살짝 튀며, 점프는 높이 뛰어 넘음, 도착 칸 고리, 벽 내려앉기+먼지, 무르기로 빠진 벽 사라짐, 안 되는 벽 흔들림, 목표 도착 띠 깜빡임·금빛 고리
- 쿼리도 소리: 말 톡, 점프, 벽 끼우기, 안 되는 곳, 목표 도착, 무르기
- 상대·컴퓨터 수도 화면 변화로 같은 소리·움직임, 새로 열면 다시 재생 안 함, 숨은 탭 내 차례 소리는 방 화면에 맡김

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 13:08:18 +09:00

35 lines
1.4 KiB
TypeScript

/** 쿼리도 소리: 나무 말과 나무 벽. Short and soft; the site volume is applied by feedback.ts. */
import { noise, sfx, tone } from '../../lib/feedback';
/** When the jump sound lands (ms), matching the hop animation in index.tsx. */
export const JUMP_LAND_MS = 250;
/** A soft wooden "tok" (one pawn step). */
function tok(delay = 0, gain = 0.14): void {
tone(560, 55, 'triangle', gain, delay);
noise(26, gain * 0.45, delay, 'bandpass', 1500, 1.6);
}
export const qdSound = {
/** Pawn moved one cell. */
step: () => tok(),
/** Pawn jumped over another: a little hop up, then the tok on landing. */
jump: () => {
tone(360, 150, 'sine', 0.07, 0, { slideTo: 720 });
tok(JUMP_LAND_MS, 0.15);
},
/** Wall set into the groove: lower and firmer than a pawn, with a short knock as it settles. */
wall: () => {
noise(45, 0.16, 0, 'bandpass', 850, 1.3);
tone(190, 95, 'triangle', 0.17);
tone(300, 40, 'square', 0.025, 4);
noise(35, 0.07, 75, 'lowpass', 650);
},
/** A wall that cannot go there (subtle). */
refuse: () => tone(175, 120, 'triangle', 0.08, 0, { slideTo: 125 }),
/** A pawn reached its goal line: a short rising run (the win/lose jingle is played by the room). */
goal: (delay = 0) => [523, 659, 784, 1046].forEach((f, i) => tone(f, 120, 'triangle', 0.08, delay + 60 + i * 65)),
/** Moves taken back (무르기). */
undo: () => sfx.whoosh(),
};