This commit is contained in:
2025-12-19 02:17:51 +00:00
parent fcfff91d99
commit 41473f3b24
2 changed files with 1 additions and 5 deletions
-1
View File
@@ -90,7 +90,6 @@ export type SnakeCursorManager = CursorManager & {
export type ScoreManager = {
timeValue: number;
totalKeystrokes: number;
finalScore: number | null;
startTimer: () => void;
stopTimer: () => void;
resetTimer: () => void;
+1 -4
View File
@@ -8,18 +8,15 @@ export type UseScoreParams = {
currentScore: number;
};
export function useScore({ gameStatus, keyLog, currentScore }: UseScoreParams) {
export function useScore({ gameStatus, keyLog }: UseScoreParams) {
const timer = useTimer();
const { timeValue, startTimer, stopTimer, resetTimer } = timer;
useScoreTime({ gameStatus, timer });
const finalScore = gameStatus === 'game-over' || gameStatus === 'game-won' ? currentScore : null;
return {
timeValue,
totalKeystrokes: keyLog.length,
finalScore,
startTimer,
stopTimer,
resetTimer,