A browser-based Gomoku (Five in a Row) strategy game with personality-driven AI opponents. Challenge Bella, Coop, or Bentley - three unique characters with distinct playing styles and personalities!
- Classic Gomoku gameplay - Connect 5 stones in a row to win on a 15x15 board
- Three AI opponents with unique personalities and difficulty levels:
- Bella ๐ (Easy): Sweet, playful puppy who's still learning
- Coop ๐ฎ (Medium): Friendly arcade owner with solid strategy
- Bentley ๐บ (Hard): Ruthless mastermind with advanced threat detection
- Character-driven experience - Each opponent has unique catchphrases, reactions, and images
- Smart AI patterns - Pattern recognition, threat detection, and multi-step lookahead
- Smooth animations - Clean board rendering with visual feedback
- Sound effects - Web Audio API for stone placement and victory/defeat sounds
- Leaderboard system - Track your wins, losses, win streaks, and performance stats
- Responsive UI - Beautiful amber-themed board with character avatars
- Keyboard controls - Full accessibility support
- React 19 with TypeScript - Latest React features with strict type safety
- Vite 5 - Lightning-fast build tool and dev server
- Tailwind CSS + shadcn/ui - Beautiful, accessible UI components
- React Router 7 - Client-side routing
- Web Audio API - Dynamic sound effects
- Error Boundaries - Graceful error handling
- Node.js 18+
- npm 9+
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewObjective: Get 5 stones in a row (horizontally, vertically, or diagonally) before your opponent.
Gameplay:
- You play as Black, your opponent plays as White
- Click any empty intersection to place your stone
- First player to connect 5 stones in a row wins
- If the board fills with no winner, the game is a draw
Strategy Tips:
- Control the center of the board early
- Create multiple threats simultaneously
- Watch for opponent patterns and block threats
- Open threes and fours are powerful attacking moves
Enthusiastic puppy who's still learning the game. Makes random moves and gets easily distracted. Perfect for beginners!
Playing Style: Random move selection from relevant positions
Friendly arcade owner who knows his games. Plays solid strategy and blocks threats.
Playing Style:
- Detects immediate winning moves
- Blocks opponent's winning threats
- Evaluates patterns and creates strategic positions
Calculating, intense champion who thinks several moves ahead. Shows no mercy!
Playing Style:
- Advanced threat detection and blocking
- Multi-step pattern recognition
- Creates multiple simultaneous threats
- Evaluates open-fours, fours, and open-threes
- Strategic scoring with weighted randomness
gomoku/
โโโ src/
โ โโโ components/
โ โ โโโ ui/ # shadcn/ui components
โ โ โโโ Board.tsx # 15x15 game board
โ โ โโโ Square.tsx # Individual square component
โ โ โโโ GameControls.tsx # Difficulty selector and controls
โ โ โโโ VictoryDialog.tsx # End game dialog with character reactions
โ โ โโโ LeaderboardDialog.tsx # Stats and leaderboard
โ โโโ hooks/
โ โ โโโ useGomokuGame.ts # Game state management
โ โ โโโ useLeaderboard.ts # Stats tracking
โ โ โโโ useGameAudio.ts # Sound effects
โ โ โโโ useCharacterSelection.ts # Character management
โ โโโ lib/
โ โ โโโ gomokuRules.ts # Game rules engine
โ โ โโโ aiStrategies.ts # AI algorithms (easy, medium, hard)
โ โ โโโ utils.ts # Utility functions
โ โโโ pages/
โ โ โโโ GomokuGame.tsx # Main game page
โ โโโ types/
โ โ โโโ gomoku.types.ts # TypeScript type definitions
โ โโโ App.tsx # Main app with routing
โ โโโ main.tsx # Entry point
โโโ shared/
โ โโโ characters.ts # Character definitions (Bella, Coop, Bentley)
โโโ public/
โ โโโ characters/ # Character images
โโโ index.html
โโโ vite.config.ts
โโโ tailwind.config.js
โโโ package.json
Build the production bundle:
npm run buildThe dist/ folder contains all static assets ready to deploy to any static hosting service (Netlify, Vercel, GitHub Pages, etc.).
The game is a single-page application (SPA) with no backend requirements - all game logic runs client-side.
npm run lint # Run ESLint
npm run lint:fix # Auto-fix ESLint issues
npm run format # Format code with Prettier
npm run type-check # Run TypeScript compilerCharacters are defined in /shared/characters.ts with:
- Unique personalities and backstories
- Custom avatars and reaction images
- Difficulty-specific catchphrases
- Theme colors and emojis
Contributions are welcome! This is an open-source project created for learning and portfolio purposes.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- TypeScript strict mode compliance
- ESLint passes with no errors
- Code is formatted with Prettier
- Maintain the existing code style
This project is licensed under the MIT License - see the LICENSE file for details.
Created by M. Cooper for www.mcooper.com
Challenge the dogs! Can you beat Bentley?
