From 2dcab21a04505dc4f42c821dff7bd37f3b879cc7 Mon Sep 17 00:00:00 2001 From: Andre Padez Date: Thu, 30 Oct 2025 23:57:40 +0000 Subject: [PATCH] test(phase2): update example app to display metrics - Display totalKeystrokes from scoreManager - Display finalScore when game ends (game-over or game-won) - Changed 'Keys' label to 'Keystrokes' for clarity - Added 'game-won' status message --- example/src/App.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example/src/App.tsx b/example/src/App.tsx index cf4a8f6..aec9ebe 100755 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -27,8 +27,13 @@ function App() { Score: {score}
- Keys: {keyLog.length} + Keystrokes: {scoreManager.totalKeystrokes}
+ {scoreManager.finalScore !== null && ( +
+ Final Score: {scoreManager.finalScore} +
+ )}
@@ -37,6 +42,7 @@ function App() { {gameStatus === "waiting" &&

Press space to start

} {gameStatus === "started" &&

Use hjkl to change direction • Press q to quit

} {gameStatus === "game-over" &&

Game Over! Press space to restart

} + {gameStatus === "game-won" &&

You Won! Press space to restart

}
);