- 메인 페이지에서 배경, 말, 주사위면을 커스텀하게 지정하도록 변경.
- 모든 데이터를 로컬에 저장하고, 가져오기 및 내보내기를 할 수 있도록 수정.
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
applyLandEvent,
|
||||
type PlaneCell,
|
||||
} from './cell-event';
|
||||
import { getAssets } from './asset-storage';
|
||||
|
||||
const PLANE_SIZE = { width: 9, height: 7 } as const;
|
||||
const STEP_MS = 280;
|
||||
@@ -16,9 +17,9 @@ const CELL_TYPES = ['한잔', '안주', '모두한잔', '두잔', '벌칙1', '
|
||||
|
||||
/** 특수 칸 배치 (28칸 기준 인덱스) */
|
||||
const SPECIAL_CELLS: Record<number, { type: string; eventId: string }> = {
|
||||
7: { type: '무인도', eventId: 'island' },
|
||||
8: { type: '무인도', eventId: 'island' },
|
||||
14: { type: '역방향', eventId: 'reverse' },
|
||||
21: { type: '비행기', eventId: 'airplane' }, // → 시작(0)
|
||||
22: { type: '비행기', eventId: 'airplane' }, // → 시작(0)
|
||||
};
|
||||
|
||||
function randomType() {
|
||||
@@ -85,6 +86,7 @@ export default function DicePlane() {
|
||||
const chessmanRef = useRef(new Chessman(28));
|
||||
const boardRef = useRef(dicePlaneArray);
|
||||
const [chessmanIndex, setChessmanIndex] = useState(0);
|
||||
const [chessmanSrc, setChessmanSrc] = useState('/chessman/default.png');
|
||||
const [hopKey, setHopKey] = useState(0);
|
||||
const [moving, setMoving] = useState(false);
|
||||
const [landedLabel, setLandedLabel] = useState<string | null>(null);
|
||||
@@ -98,6 +100,7 @@ export default function DicePlane() {
|
||||
chessmanRef.current = new Chessman(cells.length, 0);
|
||||
boardRef.current = cells;
|
||||
setChessmanIndex(0);
|
||||
setChessmanSrc(getAssets().chessman);
|
||||
setHopKey(0);
|
||||
setLandedLabel(null);
|
||||
setStatusText('시계방향');
|
||||
@@ -255,7 +258,12 @@ export default function DicePlane() {
|
||||
})}
|
||||
|
||||
{chessmanCell && (
|
||||
<ChessmanPiece x={chessmanCell.x} y={chessmanCell.y} hopKey={hopKey} />
|
||||
<ChessmanPiece
|
||||
x={chessmanCell.x}
|
||||
y={chessmanCell.y}
|
||||
hopKey={hopKey}
|
||||
src={chessmanSrc}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user