scoreManager implemented flawlessly

This commit is contained in:
2025-10-19 15:29:01 +01:00
parent 07f218f4dd
commit a6f066d738
9 changed files with 316 additions and 3 deletions
+4 -1
View File
@@ -3,6 +3,7 @@ import { useBoard } from './useBoard';
import { useCursor } from './useCursor';
import { useGameStatus } from './useGameStatus';
import { useHeroRender } from './useCursor';
import { useScore } from './useScore';
export function useGame(options: GameOptions, platformHook?: unknown): GameManager {
const { cols, rows } = options;
@@ -13,8 +14,9 @@ export function useGame(options: GameOptions, platformHook?: unknown): GameManag
const hero = cursor.hero;
const renderer = useHeroRender({ gameStatus: gameStatusManager.gameStatus, board, hero });
const scoreManager = useScore({ board, hero, gameStatusManager, keyManager });
const gameManager = {
const gameManager: GameManager = {
containerRef,
...keyManager,
...gameStatusManager,
@@ -22,6 +24,7 @@ export function useGame(options: GameOptions, platformHook?: unknown): GameManag
cursor,
hero,
renderer,
scoreManager,
}
if (typeof platformHook === 'function') {