Example #1
0
 public void StartEvent1()
 {
     EventTitle.GetComponent <Text>().text = "Congratulations!";
     EventDesc.GetComponent <Text>().text  = "You've earned points for advancing!";
     EventText.GetComponent <Text>().text  = "You've earned " + diceSideThrown + " points!";
     //Debug.Log("try again 2");
     PanelEvent.gameObject.SetActive(true);
     Dice.gameObject.SetActive(false);
 }
Example #2
0
    public void waypointEventPlayer(ref int waypoint, ref GameObject player, ref bool playerTurn)
    {
        //number of tiles movement/points for tile event
        switch (waypoint)
        {
        case 4:
            TilePoint = 2;
            break;

        case 9:
            TilePoint = -1;
            break;

        case 14:
            TilePoint = -2;
            break;

        case 19:
            TilePoint = -3;
            break;

        case 24:
            TilePoint = 2;
            break;

        case 29:
            TilePoint = -4;
            break;

        default:
            playerTurn     = false;
            TileEventCheck = false;
            return;
        }

        // Debug.Log("player waypoint: " + waypoint);
        //start moving forward/backward
        switch (waypoint)
        {
        case 4:
        case 24:
            EventTitle.GetComponent <Text>().text = "Congratulations!";
            EventDesc.GetComponent <Text>().text  = "You've earned extra points from tile event!";
            EventText.GetComponent <Text>().text  = "You've earned " + TilePoint + " points! \n" + "You've moved " + TilePoint + " tiles forward!";
            if (!move)
            {
                StartCoroutine(TileEventPanel(true, false));
            }
            break;

        case 9:
        case 14:
        case 19:
        case 29:
            //Debug.Log("Back allowed");
            EventTitle.GetComponent <Text>().text = "Better Luck Next Time!";
            EventDesc.GetComponent <Text>().text  = "Oh no! You've lost some points from tile event!";
            EventText.GetComponent <Text>().text  = "You've lost " + Mathf.Abs(TilePoint) + " points! \n" + "You've moved " + Mathf.Abs(TilePoint) + " tiles backwards!";
            if (!back)
            {
                Debug.Log("try again");
                StartCoroutine(TileEventPanel(false, true));
            }
            break;

        default:
            player.GetComponent <FollowThePath>().moveAllowed = false;
            break;
        }

        waypointEventPoint(TilePoint, ref waypoint, ref player, ref playerTurn);
    }