A modern 3D anti-chess game built with Three.js, TailwindCSS and TypeScript with React, hence the name (TTTS)uicidal Chess ;)
In this unique twist on chess, players must strategically lose their pieces to win the game.
TTTSuicidalChess/
โโโ src/
โ โโโ components/ # React components
โ โ โโโ board/ # Chess board components
โ โ โโโ pieces/ # Chess piece components
โ โ โโโ ui/ # User interface components
โ โโโ services/ # Game logic and services
โ โ โโโ aiService.ts # AI opponent logic
โ โ โโโ roomService.ts # Multiplayer room management
โ โโโ models/ # TypeScript interfaces and types
โ โโโ utils/ # Utility functions and helpers
โ โโโ hooks/ # Custom React hooks
โ โโโ context/ # React context providers
โ โโโ App.tsx # Main application component
โ โโโ App.css # Main application styles
โ โโโ index.css # Global styles
โ โโโ main.tsx # Application entry point
โ โโโ vite-env.d.ts # Vite environment declarations
โโโ public/ # Static assets
โโโ dist/ # Production build output
โโโ config files # Various configuration files
src/components/board/: Contains the 3D chess board implementationChessBoard.tsx: Main board component with Three.js integrationSquare.tsx: Individual square component
src/components/pieces/: Chess piece componentsPiece.tsx: Base piece component- Individual piece components (Pawn, Knight, etc.)
src/components/ui/: User interface componentsStatusBar.tsx: Game status and score displayControls.tsx: Game control buttons and settingsGameOver.tsx: Game over modal and results display
src/services/aiService.ts: AI opponent implementation- Handles AI move generation and difficulty levels
src/services/roomService.ts: Multiplayer room management- Handles room creation, joining, and game state synchronization
src/App.tsx: Main application component and game containersrc/main.tsx: Application entry point and React initializationsrc/models/: TypeScript interfaces for game entitiessrc/utils/: Helper functions for game logicsrc/hooks/: Custom React hooks for game functionalitysrc/context/: React context providers for global statesrc/index.css: Global styles and Tailwind importssrc/App.css: Application-specific styles
- Objective: Lose all your pieces to win the game
- Forced Captures: If a capture is available, it must be made
- Scoring: Players earn points when their pieces are captured
- Turn Order: Players alternate turns, starting with White
- Piece Movement: Pieces move according to standard chess rules
- Game End: The game ends when one player loses all their pieces
- Each captured piece is worth 1 point
- The player with the most points when they lose all pieces wins
- If a player has no legal moves, they lose the game
- Node.js (v16 or higher)
- npm (v7 or higher)
- Clone the repository:
git clone https://github.com/jraleman/TTTSuicidalChess.git
cd TTTSuicidalChess- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:5173
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run host- Start server with host accessnpm run deploy- Deploy to GitHub Pages
- Build the project:
npm run build- Deploy to GitHub Pages:
npm run deploy- The site will be available at: https://jraleman.com/TSuicidalChess/
To preview the production build locally:
npm run build
npm run preview- Frontend Framework: React 18
- 3D Graphics: Three.js
- Type Safety: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- Build Tool: Vite
@react-three/drei: React components for Three.js@react-three/fiber: React renderer for Three.js@react-three/postprocessing: Post-processing effectsthree: 3D graphics libraryzustand: State managementautoprefixer: CSS post-processorpostcss: CSS transformation tool
- 3D interactive chessboard
- Real-time piece movement
- Forced capture validation
- Score tracking
- Game progress indicator
- Mobile-responsive design
- Smooth piece animations
- Capture sound effects
- Status bar with game information
- Game over modal
- Sound toggle controls
- Volume adjustment
The game is fully responsive and optimized for:
- Desktop browsers
- Mobile devices
- Tablet screens
- Different aspect ratios
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow TypeScript best practices
- Maintain consistent code style
- Add tests for new features
- Update documentation as needed
- Keep commits clean and descriptive
This project is licensed under the MIT License - see the LICENSE file for details.
- Jose Ramon - Initial work - jraleman
- Three.js community for 3D graphics support
- React team for the amazing framework
- Tailwind CSS team for the utility-first CSS framework
- All contributors and supporters
- Router support for components view (App.tsx)
- Room Multiplayer (online)
- Fix room game mode implementation
- Implement username system
- Add spectator mode
- Add chat system between players
- Practice Mode
- Position setup and analysis
- Move validation feedback
- Common patterns and strategies guide
- Add game save/load
- Add game replay system
- Add move annotations
- Add game sharing
- Statistics and Analytics
- Add player statistics
- Add game analytics
- Add performance graphs
- Add achievement system
- Game Interface
- Automatic zoom level based on screen size
- Automatic board centering
- Highlight forced captures
- Optional movement preview
- Add piece movement arrows
- Add move history panel
- Add captured pieces display
- Visual Enhancements
- Add particle effects for captures
- Add piece movement trails
- Add board themes (wood, marble, etc.)
- Add piece themes (classic, modern, etc.)
- Add board rotation controls
- Add camera angle presets
- Sound and Audio
- Add background music
- Add more sound effects
- Menu and Navigation
- Add animated transitions
- Add game settings panel
- Add keyboard shortcuts
- Add tooltips and help system
- Add accessibility options
- Add FAQ section
- Add comprehensive game rules
- Add strategy guides
- Add developer documentation
- Add video tutorials
Note: All features are designed to work with the current tech stack and GitHub Pages hosting. Some features may require additional dependencies but will be chosen to maintain compatibility and performance.
For support, please open an issue in the GitHub repository or contact the maintainers.