A beautifully designed, cross-platform Tic-Tac-Toe game built with Flutter. This modern implementation features sleek animations, haptic feedback, sound effects, theme switching, and persistent scoring.
- 🎮 Clean, responsive UI for both mobile and desktop platforms
- 🎯 Smooth animations for game pieces and winning lines
- 🌓 Light and dark theme support with persistent preference
- 🔊 Sound effects with toggle control
- 📱 Haptic feedback on mobile devices
- 📊 Score tracking with persistent storage
- 💻 Optimized for desktop with proper window management
- 🏆 Winning line animation
- 🔄 Game state management using Provider
- Flutter SDK (latest stable version recommended)
- Dart SDK
- Android Studio, VS Code, or another IDE with Flutter support
-
Clone the repository:
git clone https://github.com/yourusername/xo_game.git cd xo_game -
Install dependencies:
flutter pub get
-
Run the app:
flutter run
lib/
├── main.dart # Application entry point
├── screens/
│ └── game_screen.dart # Main game screen
├── providers/
│ ├── game_state.dart # Game logic and state management
│ └── theme_provider.dart # Theme state management
├── theme/
│ ├── app_colors.dart # Color definitions
│ └── app_theme.dart # Theme configurations
├── utils/
│ ├── platform_utils.dart # Platform-specific utilities
│ └── window_manager.dart # Desktop window management
└── widgets/
├── animated_game_cell.dart # Individual game cell with animations
├── game_board.dart # Complete game board
└── winning_line_painter.dart # Custom painter for winning line
- The game starts with Player X
- Players take turns marking empty cells on the 3x3 grid
- The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins
- If all cells are filled and no player has three in a row, the game ends in a draw
- The score is tracked across multiple games
- Use the "New Game" button to reset the board and start a new round
The app comes with both dark and light themes. The theme preference is saved between sessions. Toggle the theme by clicking the sun/moon icon in the top right corner.
Sound effects can be toggled on/off through the settings dialog. The preference is saved between sessions.
- 📱 Android
- 📱 iOS
- 💻 Windows
- 💻 macOS
- 💻 Linux
- 🌐 Web (limited functionality)
provider: For state managementshared_preferences: For persistent storagewindow_manager: For desktop window managementaudioplayers: For sound effectsvibration: For haptic feedback
Contributions are welcome! Feel free to submit a pull request or create an issue for any bugs or feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Flutter team for the amazing framework
- The open-source community for inspirational game implementations