An open API service indexing awesome lists of open source software.

https://github.com/khaled71612000/xo-using-unity

a project to implement the classic tic tac toe game in unity
https://github.com/khaled71612000/xo-using-unity

unity

Last synced: 3 months ago
JSON representation

a project to implement the classic tic tac toe game in unity

Awesome Lists containing this project

README

          

# XO Using Unity

![Unity](https://img.shields.io/badge/Unity-000000?logo=unity&logoColor=white)
![C#](https://img.shields.io/badge/C%23-239120?logo=c-sharp&logoColor=white)
![License](https://img.shields.io/badge/license-MIT-green)

**XO Using Unity** is a Unity project that implements the classic Tic-Tac-Toe game. This project offers an engaging and interactive gaming experience with a clean and intuitive user interface.

## Key Components

### GameManager.cs
- Manages game states, including player turns.
- Checks win conditions and handles game resets.

### GridSpace.cs
- Handles individual grid spaces.
- Captures player input and updates grid spaces accordingly.

### Player.cs
- Manages player data, such as symbols and turn tracking.

### UIManager.cs
- Updates UI elements, including score and messages.
- Handles user interface interactions.

## Features

- **Turn-Based System:** Alternates turns between players.
- **Win Condition Detection:** Announces wins or draws.
- **Game Reset Functionality:** Allows for restarting the game.
- **Simple and Intuitive UI:** Provides an easy-to-use interface.


![image](https://github.com/khaled71612000/XO-Using-Unity/assets/59780800/33ecf76c-9fd5-4aa7-ae7d-7cd9012afcdf)

## Screenshots

![Screenshot 1](https://raw.githubusercontent.com/khaled71612000/XO-Using-Unity/HEAD/Assets/Pixel Cursors/Cursors/basic_01 YELLOW.png)

![Screenshot 2](https://raw.githubusercontent.com/khaled71612000/XO-Using-Unity/HEAD/Assets/Sprites/1.png)

![Screenshot 3](https://raw.githubusercontent.com/khaled71612000/XO-Using-Unity/HEAD/Assets/Sprites/2.png)

![Screenshot 4](https://raw.githubusercontent.com/khaled71612000/XO-Using-Unity/HEAD/Assets/Sprites/3.png)

![Screenshot 5](https://raw.githubusercontent.com/khaled71612000/XO-Using-Unity/HEAD/Assets/Sprites/4.png)

## Architecture

Key classes and systems (from source code):

- **`GameController`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — orchestrates game-wide systems — Key methods: `TicTacToeButtton`
- **`CameraController`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — orchestrates game-wide systems — controls camera positioning and follow logic
- **`TextMeshSpawner`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — manages object spawning and pooling
- **`Benchmark01_UGUI`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — user interface and HUD rendering
- **`ChatController`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — orchestrates game-wide systems
- **`EnvMapAnimator`** (extends `MonoBehaviour`) — Unity component attached to a GameObject

## Tech Stack

| Technology | Role |
|---|---|
| Unity 3D | Game engine |
| C# | Gameplay scripting |
| Unity Physics | Rigidbody & collision |
| Git | Version control |

## Getting Started

### Prerequisites
- [Unity Hub](https://unity.com/download) + Unity 2019.4 LTS or higher
- Visual Studio 2019+ or VS Code

### Setup
```bash
git clone https://github.com/khaled71612000/XO-Using-Unity.git
```
1. Open **Unity Hub** → **Add** → select the cloned folder
2. Open **Assets/Scenes/** → double-click the main scene
3. Press ▶ **Play**