/// <summary> /// Start the tic tac toe game. /// </summary> /// <param name="args">Game parameters: Number of collumns, number of rows, how many in a row is needed to win</param> public override void Start(GraphicsDevice gd, int[] args) { opponent = null; RowNum = args[0]; ColNum = args[1]; ToWin = args[2]; FeatureNum = ColNum * RowNum * 3; // Every tile has three features - isplayer1? isplayer2? isnoplayer? ActionNum = RowNum * ColNum; StateNum = (int)Math.Pow(3, RowNum * ColNum); float deltaX = Game1.w_width / ColNum; float deltaY = Game1.w_height / RowNum; // Create textures for drawing Board = CreateBoard(gd); Circle = ShapeCreator.CreateHollowCircle(gd, deltaX, deltaY, 5); X = ShapeCreator.CreateX(gd, deltaX, deltaY); Tiles = new Players[ColNum, RowNum]; for (int x = 0; x < ColNum; x++) { for (int y = 0; y < RowNum; y++) { Tiles[x, y] = Players.NoPlayer; } } Running = true; CurrTurn = Players.Player1; }