diff --git a/src/App.jsx b/src/App.jsx index 9f1d03d..dd5a0b6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -49,6 +49,7 @@ export default function App() { setAnimState({ name, count: countRef.current }); }, []); + const actionCoolRef = useRef(0); const doSkillRef = useRef(null); const handleKey = useCallback((e) => { @@ -58,6 +59,9 @@ export default function App() { } if (e.code === 'Space') { e.preventDefault(); + const now = Date.now(); + if (now - actionCoolRef.current < 3000) return; + actionCoolRef.current = now; const idx = actionIndexRef.current; const anim = ACTION_SEQUENCE[idx % ACTION_SEQUENCE.length]; playAnim(anim);