feat: implement complete score tracking system

- Track score (starts at 0)
- +1 score and +1 correct for each correct character typed
- -1 score and +1 missed for each wrong character typed
- +1 deaths for each collision with ship
- Score resets when game starts
- All metrics exposed through ScoreManager
- Updated example app UI with colorful scoreboard showing:
  - Time (gray)
  - Score (neutral)
  - Correct (green)
  - Missed (yellow)
  - Deaths (red)
  - Keystrokes (neutral)
- Uses grid layout for organized metric display
- Score cannot go below 0 (clamped to minimum)
This commit is contained in:
2025-11-03 23:04:26 +00:00
parent 08c2d40d23
commit 7ee42a8dc1
6 changed files with 74 additions and 8 deletions
+1
View File
@@ -46,6 +46,7 @@
"dist"
],
"scripts": {
"dev": "cd example && bun run dev",
"build": "tsc --outDir dist --declaration --emitDeclarationOnly false && node -e \"const fs = require('node:fs'); fs.mkdirSync('dist', { recursive: true }); fs.copyFileSync('src/game.css', 'dist/game.css'); fs.copyFileSync('package.json', 'dist/package.json');\"",
"prepublishOnly": "npm run build"
},