feat: implement game control callbacks in MemoryPairsGame
Connect game control buttons to actual game actions using context functions for Setup, New Game, and Quit functionality. - Setup: exit session and navigate to /arcade/matching (returns to setup) - New Game: call resetGame() from context - Quit: exit session and navigate to /arcade 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import { css } from '../../../../../styled-system/css'
|
||||
|
||||
export function MemoryPairsGame() {
|
||||
const router = useRouter()
|
||||
const { state, exitSession } = useArcadeMemoryPairs()
|
||||
const { state, exitSession, resetGame } = useArcadeMemoryPairs()
|
||||
const { setFullscreenElement } = useFullscreen()
|
||||
const { canModifyPlayers } = useArcadeRedirect({ currentGame: 'matching' })
|
||||
const gameRef = useRef<HTMLDivElement>(null)
|
||||
@@ -37,6 +37,14 @@ export function MemoryPairsGame() {
|
||||
exitSession()
|
||||
router.push('/arcade')
|
||||
}}
|
||||
onSetup={() => {
|
||||
// Exit current session and return to arcade (which will redirect to setup)
|
||||
exitSession()
|
||||
router.push('/arcade/matching')
|
||||
}}
|
||||
onNewGame={() => {
|
||||
resetGame()
|
||||
}}
|
||||
>
|
||||
<StandardGameLayout>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user