August 2018
Beginner
334 pages
10h 19m
English
We will create a new class, deriving it from Board, override its parent's methods, and create new ones:
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public class BoardTicTac : Board
{
protected int[,] board;
protected const int ROWS = 3;
protected const int COLS = 3;
}
public BoardTicTac(int player = 1)
{
this.player = player;
board = new int[ROWS, COLS];
board[1,1] = 1;
}
private int GetNextPlayer(int p)
{
if (p == 1)
return 2;
return 1;
}
Read now
Unlock full access