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