-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
48 lines (39 loc) · 1.06 KB
/
types.ts
File metadata and controls
48 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
export enum TetrominoType {
I = 'I',
J = 'J',
L = 'L',
O = 'O',
S = 'S',
T = 'T',
Z = 'Z',
}
export type TetrominoShape = number[][];
export interface Tetromino {
type: TetrominoType;
shape: TetrominoShape;
}
export type GridCell = {
type: TetrominoType;
locked: boolean;
} | null;
export type Grid = GridCell[][];
export interface GameState {
grid: Grid;
score: number;
level: number;
gameOver: boolean;
paused: boolean;
}
export interface Theme {
name: string;
background: string; // App background (CSS gradient or color)
boardBackground: string;
gridLines: string; // Color of grid lines
textColor: string;
accentColor: string; // For UI buttons/borders
pieces: {
[key in TetrominoType]: string; // Hex color for each piece
};
}
export type Difficulty = 'Easy' | 'Medium' | 'Hard';
export type SoundEvent = 'move' | 'rotate' | 'drop' | 'hardDrop' | 'clear' | 'gameOver' | 'levelUp' | 'eat' | 'place' | 'flap' | 'scorePoint' | 'pongHit' | 'pongCriticalHit' | 'pongWall' | 'merge' | 'spawn' | 'shoot' | 'pop' | 'bounce';