feat: implement falling letters spawning from top

- Letters spawn at random horizontal positions every 1 second
- Letters fall at 100px/second from top to bottom
- Random A-Z letters rendered in white monospace font
- Fix game loop to start properly when startGame called
- Remove letters that exit bottom of screen
This commit is contained in:
2025-11-03 22:01:40 +00:00
parent dce96b8453
commit 0dc4ecde72
4 changed files with 85 additions and 19 deletions
+4 -4
View File
@@ -19,11 +19,11 @@ export const getGamePhase = (status: GameStatus): GamePhase =>
// ============================================================================
export type PlayerPosition = { x: number }; // 0-9 for 10 columns
export type Word = {
export type FallingLetter = {
id: string;
text: string;
x: number; // 0-9 column position
y: number; // vertical position (0 = top, increases downward)
letter: string;
x: number; // 0-800 pixel position
y: number; // 0-600 pixel position
};
// ============================================================================