void Awake() { //accesses the location of white pieces whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>(); //accesses the location of black pieces blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>(); //accesses the tiles boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>(); tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>(); //accesses the current turn turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>(); //turns off the piece's halo (gameObject.GetComponent("Halo") as Behaviour).enabled = false; //saves the pawn's original position homePosX = gameObject.transform.position.x; homePosY = gameObject.transform.position.y; //accesses piece's location coordinates = gameObject.GetComponent<positionScript>(); myKing = GameObject.Find("Black King").GetComponent<kingMovement>(); pieceColor = gameObject.transform.tag; gameObject.GetComponent<positionScript>().pieceColor = pieceColor; gameObject.GetComponent<positionScript>().pieceTag = pieceTag; coordinates.xHome = homePosX; coordinates.yHome = homePosY; }
public void Init() { moveSpeed = FindObjectOfType <gridSnap>().gridSize; player = GameObject.FindGameObjectWithTag("Player"); walkt = player.GetComponent <walkTracker>(); turnt = player.GetComponent <turnTracker>(); }
// Use this for initialization void Start() { //reference to the other scripts boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>(); mover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>(); turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>(); //creates the boolean array for tracking black pieces blackPieceOnSquare = new bool[8, 8]; }
// Use this for initialization void Start() { //accesses the location of white pieces whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>(); //accesses the location of black pieces blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>(); boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>(); mover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>(); turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>(); }
void Awake() { //stores piece's color pieceColor = gameObject.transform.tag; if (pieceColor == "Black") { myKing = GameObject.Find("Black King").GetComponent<kingMovement>(); } else if (pieceColor == "White") { myKing = GameObject.Find("White King").GetComponent<kingMovement>(); } //turns off the piece's halo (gameObject.GetComponent("Halo") as Behaviour).enabled = false; //accesses the location of white pieces whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>(); //accesses the location of black pieces blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>(); //accesses the tiles boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>(); tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>(); //accesses the current turn turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>(); //accesses piece's location homePosX = gameObject.transform.position.x; homePosY = gameObject.transform.position.y; gameObject.GetComponent<positionScript>().xHome = homePosX; gameObject.GetComponent<positionScript>().yHome = homePosY; coordinates = gameObject.GetComponent<positionScript>(); //creates the move and attack square arrays attackSquares = new GameObject[maxMoveSquares]; diagMoveSquaresUpLeft = new GameObject[maxMoveSquares]; diagMoveSquaresUpRight = new GameObject[maxMoveSquares]; diagMoveSquaresDownLeft = new GameObject[maxMoveSquares]; diagMoveSquaresDownRight = new GameObject[maxMoveSquares]; attackSquaresColor = new Color[maxMoveSquares]; gameObject.GetComponent<positionScript>().pieceColor = pieceColor; gameObject.GetComponent<positionScript>().pieceTag = pieceTag; }
void Awake() { //turns off the piece's halo (gameObject.GetComponent("Halo") as Behaviour).enabled = false; //accesses the location of white pieces whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>(); //accesses the location of black pieces blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>(); //accesses the tiles boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>(); tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>(); //accesses the current turn turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>(); //accesses piece's location coordinates = gameObject.GetComponent<positionScript>(); //sets the original position homePosX = gameObject.transform.position.x; homePosY = gameObject.transform.position.y; //creates the arrays to track movesquares squareColors = new Color[maxMoveSquares]; squares = new GameObject[maxMoveSquares]; checkSquareColors = new Color[maxMoveSquares + 1]; checkSquares = new GameObject[maxMoveSquares + 1]; //stores the pieces color pieceColor = gameObject.transform.tag; coordinates.pieceColor = pieceColor; coordinates.pieceTag = pieceTag; coordinates.xHome = homePosX; coordinates.yHome = homePosY; }
// Use this for initialization void Awake() { pieceColor = gameObject.transform.tag; if (pieceColor == "Black") { myKing = GameObject.Find("Black King").GetComponent<kingMovement>(); } else if (pieceColor == "White") { myKing = GameObject.Find("White King").GetComponent<kingMovement>(); } //turns off the piece's halo (gameObject.GetComponent("Halo") as Behaviour).enabled = false; //accesses the location of white pieces whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>(); //accesses the location of black pieces blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>(); //accesses the tiles boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>(); tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>(); //accesses the current turn turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>(); //saves the pawn's original position and accesses its current one homePosX = gameObject.transform.position.x; homePosY = gameObject.transform.position.y; coordinates = gameObject.GetComponent<positionScript>(); //creates the arrays for moveSquares vertMoveSquaresUp = new GameObject[maxMoveSquares]; vertMoveSquaresDown = new GameObject[maxMoveSquares]; horMoveSquaresLeft = new GameObject[maxMoveSquares]; horMoveSquaresRight = new GameObject[maxMoveSquares]; attackSquares = new GameObject[maxAttackSquares]; attackSquaresColor = new Color[maxAttackSquares]; gameObject.GetComponent<positionScript>().pieceColor = pieceColor; gameObject.GetComponent<positionScript>().pieceTag = pieceTag; }