feat(pong): made changes to allow local play

This commit is contained in:
Maieul BOYER 2026-01-04 14:58:20 +01:00 committed by Maix0
parent 9947970f63
commit 4ec44420db
5 changed files with 66 additions and 11 deletions

View file

@ -20,10 +20,13 @@ export type GameUpdate = {
right: { id: string, paddle: PaddleData, score: number };
ball: { x: number, y: number, size: number };
local: boolean,
}
export type GameMove = {
move: 'up' | 'down' | null,
// only used in local games
moveRight: 'up' | 'down' | null,
}
export interface ClientToServer {
@ -32,6 +35,7 @@ export interface ClientToServer {
debugInfo: () => void;
gameMove: (up: GameMove) => void;
connectedToGame: (gameId: string) => void;
localGame: () => void,
};
export interface ServerToClient {