I’m new to unity, today is my first time to use it I have make one game… it’s a board game from anime named phibrain… i only need a few things to do but i don’t know how :
- Make a legal move, now the square freely can move but i only want they to move horizontal and vertical, and give them a mark as legal move.
- Making a real player, as you see in the image there is 3 square each corner and i want make a cirlcle as a player for riding to the square legal move and the player can move from one square to other square that horizontally or vertically from them.
- I want make a winning message for the winner.
- I want make a turn for two player mode.
- I want make title/menu screen that contain “1 player, 2 player, Exit and Guide”.
- The last i want make AI.
I have edit the script to make a legal move but i have a problem, unity have parsing error with it, it i wil post the script here
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public int gameState = 0; // In this state, the code is waiting for : 0 = Piece selection, 1 = Piece animation, 2 = Player2/AI movement
//private int activePlayer = 0; // 0 = Player1, 1 = Player2, 2 = AI, to be used later
private GameObject SelectedPiece; // Selected Piece
//Update SlectedPiece with the GameObject inputted to this function
public void SelectPiece(GameObject _PieceToSelect)
{
// Change color of the selected piece to make it apparent. Put it back to white when the piece is unselected
if(SelectedPiece)
{
SelectedPiece.renderer.material.color = Color.white;
}
SelectedPiece = _PieceToSelect;
SelectedPiece.renderer.material.color = Color.black;
}
// Move the SelectedPiece to the inputted coords
public void MovePiece(Vector2 _coordToMove)
{
bool validMovementBool = false;
Vector2 _coordPiece = new Vector2(SelectedPiece.transform.position.x, SelectedPiece.transform.position.z);
{
// Don't move if the user clicked on its own cube or if there is a piece on the cube
if((_coordToMove.x != _coordPiece.x || _coordToMove.y != _coordPiece.y) || _boardPieces[(int)_coordToMove.x,(int)_coordToMove.y] != 0)
{
validMovementBool = TestMovement (SelectedPiece, _coordToMove);
}
if(validMovementBool)
{
_boardPieces[(int)_coordToMove.x, (int)_coordToMove.y] = _boardPieces[(int)_coordPiece.x, (int)_coordPiece.y];
_boardPieces[(int)_coordPiece.x , (int)_coordPiece.y ] = 0;
SelectedPiece.transform.position = new Vector3(_coordToMove.x, _pieceHeight, _coordToMove.y); // Move the piece
SelectedPiece.renderer.material.color = Color.white; // Change it's color back
SelectedPiece = null; // Unselect the Piece
ChangeState (0);
activePlayer = -activePlayer;
}
}
// Use the name of the _SelectedPiece GameObject to find the piece used
switch (_SelectedPiece.name)
{
case "Pawn":
// Pawn can move horizontally or vertically
if((_deltaX != 0 _deltaY == 0) || (_deltaX == 0 _deltaY != 0))
{
_movementLegalBool = true;
}
break;
default:
_movementLegalBool = false;
break;
}
}
The problem is : Assets/Script/GameManager.cs(62,1): error CS8025: Parsing error