Simple 3x3 TicTacToe against a bot.
Built from scratch to practice MVC pattern in Unity.
You can try the game directly in your browser:
👉 Play on itch.io
This project follows the MVC (Model-View-Controller) pattern:
- Models: Store game data and state (
BoardModel,CellModel) - Views: Handle visual representation (
CellView, UI components) - Controllers: Manage logic and coordinate between Models and Views (
BoardController,CellController,GameManager)
- GameManager: Singleton managing overall game state and events
- BoardController: Handles board logic, move validation, and win checking
- PlayerTurnManager: Manages turn-based gameplay
- BotMovement: Simple bot that makes random valid moves
- WinChecker: Detects winning conditions and draw states
- Mouse Click: Click on an empty cell to place your mark (X)
- The bot (O) will automatically make its move after yours
Assets/
├── Scripts/
│ ├── Board/
│ │ ├── BoardController.cs
│ │ ├── BoardModel.cs
│ │ ├── BoardBuilder.cs
│ │ ├── BotMovement.cs
│ │ └── WinChecker.cs
│ ├── Cell/
│ │ ├── CellController.cs
│ │ ├── CellModel.cs
│ │ └── CellView.cs
│ ├── Constants/
│ │ ├── CellValue.cs
│ │ ├── CellWinStatus.cs
│ │ └── GameStatus.cs
│ ├── Managers/
│ │ ├── GameManager.cs
│ │ └── PlayerTurnManager.cs
│ └── UI/
│ ├── DisplayWinner.cs
│ └── PlayerUIHighlighter.cs
├── Scenes/
├── Prefabs/
└── Resources/
- Unity Editor
6000.3.2f1or compatible
- Clone the repository:
git clone https://github.com/kadzyly/TicTacToe.git cd TicTacToe - Open the game scene
Assets/Scenes/GameScene.unity - Press Play to start the game

