One can create a game in many ways the way used in this blog is not absolute.
The purpose of this blog is to let the users understand unity and coding a bit better than before.

Step1: Images needed for the project.
We will be needing 4 images to create this game.
1-Cross


2-Circle

3-Board

4-Background













Step2: Setting up the Scene.
Set the game view to 2d.
1. MainCamera- Select the main camera and under Camera component it has a property named Projection set it to Orthographic.
2. GameOver- Create an empty gameobject and add sprite renderer to it. Add a sprite image to it by clicking on sprite property. Set the Color to black or any other color as per your preference.
Import the image by simply dragging the script from explorer to unity under project panel. Select the image and change it texture type to sprite 2D and UI.
3. BackGround- Used to create the black background at the back.



4. Create an empty gameobject and name it Board, Add a sprite renderer to it by simply clicking on add component. Create an image in any photo editor software like this:-

5. Now create an empty gameobject under board gameobject and add box collider and a spirit renderer to it. After that make 8 more copies of its (Ctrl+D).Name those in descending order starting from 9 to 1.
Now arrange them accordingly as shown below.

6. Create a canvas and inside a canvas create a text as right click UI>Text.
7. Create a UI Button same as created the text. Name the Button as New game and the text under button as BttnTxt. Naming them correct is important as we are going to use them in scripts.
8.Arrange all the items And at the end your Scene will look like this:

Step3: Writing the script.

Step3.1:-Onclick on a box the spirit of zero or cross must be assigned to that box.
To do that first we have to know the box we hit and then change its spirit only once so that once a box spirit is assigned to zero/cross should not change on second click on it.

Select all the box collider under board and add a tag on them naming “Boxes”.

 Now write the following script-

In this script first we will create a list which will find all the boxes in board and add them to the list. Secondly, we want an array to store are 2 cross/zero spirit.

Now in start function the script will find all the gameobjects with tag “Boxes” and will store them into the list.

In update function firstly we check if a user clicks the let mouse button a ray from the main camera is shooted towards mouse position and if the mouse is on any box the ray hits the collider.
If the hit.collider is not null than boxcollider it hits was store in a local variable box and is disabled to ensure that user cannot click on same box twice.
Secondly the spirit is assigned to the gameobject.
Right now it is only adding zero in all boxes.