mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-31 10:25:06 -06:00
Add stop_game and restart_game FFI functions to properly pause/resume the game loop during page transitions, preventing resource leaks and audio issues when navigating between pages
17 lines
425 B
TypeScript
17 lines
425 B
TypeScript
export interface PacmanModule {
|
|
canvas: HTMLCanvasElement;
|
|
_start_game?: () => void;
|
|
_stop_game?: () => void;
|
|
_restart_game?: () => void;
|
|
locateFile: (path: string) => string;
|
|
preRun: unknown[];
|
|
}
|
|
|
|
export interface PacmanWindow extends Window {
|
|
Module?: PacmanModule;
|
|
pacmanReady?: () => void;
|
|
SDL_CANVAS_ID?: string;
|
|
}
|
|
|
|
export const getPacmanWindow = (): PacmanWindow => window as unknown as PacmanWindow;
|