Ejemplo n.º 1
0
    private IEnumerator StartGameCoroutine()
    {
        chosenPoint = gbpList[Random.Range(0, gbpList.Count)];

        ball.transform.position = ballStartPos;
        ball.GetComponent <Rigidbody>().velocity        = Vector3.zero;
        ball.GetComponent <Rigidbody>().angularVelocity = Vector3.zero;

        yield return(Yielders.Get(0.5f));

        calloutText.gameObject.SetActive(true);
        calloutText.text = "(" + chosenPoint.xCoord + ", " + chosenPoint.yCoord + ")";
        readyToBlock     = true;
    }
Ejemplo n.º 2
0
    public void CheckSuccess(GridBlockPoint p)
    {
        if (!readyToBlock)
        {
            return;
        }

        readyToBlock = false;

        if (p.id == chosenPoint.id)
        {
            Success(p.transform.position, true);
        }
        else
        {
            Failure(p.transform.position, false);
        }
    }
Ejemplo n.º 3
0
    private void InitialSetup()
    {
        calloutText.gameObject.SetActive(false);
        readyToBlock = false;

        for (int i = 0; i <= GRID_HEIGHT; i++)
        {
            for (int j = 0; j <= GRID_WIDTH; j++)
            {
                GameObject go = (GameObject)Instantiate(gridBlockPoint, gridStartPosition.position + new Vector3(j + (j * GRID_SIZE), i + (i * GRID_SIZE), 0), Quaternion.identity);
                go.transform.parent = gridBlockParent;

                GridBlockPoint gbp = go.GetComponent <GridBlockPoint>();
                gbp.SetupPoint((i * GRID_WIDTH) + j + i, j, i);
                go.transform.name = gbp.id.ToString();

                gbpList.Add(gbp);
            }
        }
    }