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
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
import { useState } from "react";
|
||||
import type { GameStatus } from "../types";
|
||||
|
||||
export function useGameStatus() {
|
||||
const [gameStatus, setGameStatus] = useState<GameStatus>("waiting");
|
||||
|
||||
const startGame = () => {
|
||||
setGameStatus("started");
|
||||
};
|
||||
|
||||
const quitGame = () => {
|
||||
setGameStatus("waiting");
|
||||
};
|
||||
|
||||
return {
|
||||
gameStatus,
|
||||
setGameStatus,
|
||||
startGame,
|
||||
quitGame,
|
||||
};
|
||||
}
|
||||
|
||||
export type UseGameStatusType = ReturnType<typeof useGameStatus>;
|
||||
Reference in New Issue
Block a user