diff --git a/src/App.jsx b/src/App.jsx index bf23b3b..dd067e7 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -3,6 +3,9 @@ import Board from './components/Board.jsx' import Modal from './components/Modal.jsx' import './App.css' +const [GAME_INITIAL, GAME_RUNNING, GAME_OVER] = [0,1,2] +const INTERVAL_TIME_MS = 1500; + export default function App() { /* NOTE: * Pad refers to the squares that change color @@ -27,7 +30,6 @@ export default function App() { const [botSequenceState, setBotSequenceState] = useState([]) const [score, setScore] = useState(0) const [lives, setLives] = useState(3) - const [GAME_INITIAL, GAME_RUNNING, GAME_OVER] = [0,1,2] const [gameState, setGameState] = useState(GAME_INITIAL) /* ref is used to store latest Board state. @@ -122,7 +124,7 @@ export default function App() { // generates new sequence every second. // setInterval returns id which is used to stop loop (using clearInteral) in generateBotSequence - const intervalId = setInterval(generateBotSequence, 1500); + const intervalId = setInterval(generateBotSequence, INTERVAL_TIME_MS); console.log("intervalId: " + intervalId) sequenceIntervalId.current = intervalId } @@ -135,6 +137,22 @@ export default function App() { ) }) + const tutorialElements = ( + <> +