Commit Graph
8 Commits
Author SHA1 Message Date
pastilhas 662557c933 feat: implement game modes system with letters and words support
- Add GameMode type: 'letters' | 'words' | 'sentences' | 'paragraphs'
- Add gameMode option to GameOptions (defaults to 'letters')
- Create wordLists.ts with curated word lists for each mode
- Update FallingLetter type to track:
  - fullText: complete word/sentence/paragraph
  - charIndex: current character progress in word
- Modify word spawning to pick from mode-specific word list
- Update handleTypedLetter to support multi-character typed sequences:
  - Track progress through word (charIndex)
  - Advance to next character when correct
  - Show complete word only when fully typed
- Enhanced canvas rendering with color-coded progress:
  - Green: completed characters
  - Yellow: current character being typed
  - White: remaining characters
- Add mode selector buttons to example app
- Default to 'words' mode in example for testing
- Full TypeScript support for all modes
2025-11-03 23:10:00 +00:00
pastilhas 7ee42a8dc1 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)
2025-11-03 23:04:26 +00:00
pastilhas d69a9a6cc9 fix: correct vite alias from vim-snake to typing-chud 2025-11-03 22:53:24 +00:00
pastilhas 32045c5473 feat: add typing mechanics with visual feedback and safe margins
Implement core typing game mechanics with keyboard input handling. Correct
letters trigger explosion animation with radiating particles and spawn new
letter. Wrong letters flash red for immediate feedback. Add 50px margins on
both edges to prevent spaceship and letters from appearing at screen borders.
2025-11-03 22:38:10 +00:00
pastilhas 5a0d8b5221 feat: enforce one active letter at a time (character mode)
- Add MAX_ACTIVE_LETTERS constant set to 1
- Only spawn new letter if no letters are currently active
- Prepare for future game modes (word, sentence, paragraph)
- Change keybindings to use Escape instead of Q
2025-11-03 22:05:22 +00:00
pastilhas fb79aa0229 refactor: simplify example app by moving renderBoard call into useGame
- Remove useMounted and manual renderBoard call from example App
- Call renderBoard from useGame useEffect on initialization
- Follow vim-maze pattern for cleaner example app
2025-11-03 21:46:42 +00:00
pastilhas c036dc372d feat: implement game board rendering and spaceship player control
- Create 10x20 game board grid with retro styling
- Render spaceship emoji at player position (bottom center)
- Implement cursor movement with hjkl (left/right only)
- Add moveToStart (0) and moveToEnd ($) anchor motions
- Re-render board when cursor position changes
- Board displays dark grid with highlighted player row
2025-11-03 21:41:26 +00:00
pastilhas 80f7aa3f8a chore: initialize typing-chud project with Unified API structure
- Copy vim-snake structure stripped of game-specific logic
- Remove finalScore calculation (raw data only)
- Setup example app with keybinding state management
- Empty board renders and waits for game logic
2025-11-03 21:36:09 +00:00