Ejemplo n.º 1
0
    //public GameObject[] levels; need 2 for phases 3 and 4
    // assimiate code from Scroll_background

    void Start()
    {
        timer    = 0;
        subTimer = 0;
        //Get Camera Listeners
        cameraOneAudioLis = cameraOne.GetComponent <AudioListener>();
        cameraTwoAudioLis = cameraTwo.GetComponent <AudioListener>();

        //Grab scene controller
        sceneController = GameObject.Find("SceneController").GetComponent <Scene1Controller>();


        //Camera Position Set based on checkpoint phase
        cameraPositionChange(0);
        switch (sceneController.GetPhase())
        {
        case 1:
        case 2:
        case 3:
            vcam_1_2.Priority = 1;
            break;

        case 4:
            vcam_3.Priority = 1;
            break;

        case 5:
            vcam_4.Priority = 1;
            break;

        case 6:
            vcam_Boss.Priority = 1;
            break;

        default:
            Debug.Log("ERROR: Invalid phase.");
            break;
        }
    }
Ejemplo n.º 2
0
    public EdgeCollider2D edge;  //Test

    // Start is called before the first frame update
    void Start()
    {
        routeToGo        = 0;
        tParam           = 0f;
        coroutineAllowed = true;
        speed            = P3_speed;
        sceneController  = GameObject.Find("SceneController").GetComponent <Scene1Controller>();
        // Initialize which path to take based on phase
        switch (sceneController.GetPhase())
        {
        case 5:
            path = 1;
            break;

        case 6:
            path = 2;
            break;

        default:
            path = 0;
            break;
        }
    }
Ejemplo n.º 3
0
    private IEnumerator GoByTheRoute(int routeNumber)
    {
        coroutineAllowed = false;

        // add if statements if(path==# && routeNumber == #){ change [speed] value for each route as needed.
        // Phase 4 - route 1 (before fence) camera
        if (path == 1 && routeNumber == 0)
        {
            speed = P4_speed;
        }
        // Phase 4 - route 2 camera
        if (path == 1 && routeNumber == 1)
        {
            vcam2.Priority = 0;
            vcam3.Priority = 1;
            speed          = P4_speed_2;
            edge.enabled   = true;
        }
        //Path --> route --> position point.  what this code is doing
        if (0 <= routeNumber && routeNumber < Path[path].childCount)
        {
            Vector2 p0 = Path[path].GetChild(routeNumber).GetChild(0).position;
            Vector2 p1 = Path[path].GetChild(routeNumber).GetChild(1).position;
            Vector2 p2 = Path[path].GetChild(routeNumber).GetChild(2).position;
            Vector2 p3 = Path[path].GetChild(routeNumber).GetChild(3).position;

            while (tParam < 1)
            {
                tParam += Time.deltaTime * speed;   /// requires some form of speed variable

                Vector2 lastPosition = transform.position;

                AirPosition = Mathf.Pow(1 - tParam, 3) * p0 +
                              3 * Mathf.Pow(1 - tParam, 2) * tParam * p1 +
                              3 * (1 - tParam) * Mathf.Pow(tParam, 2) * p2 +
                              Mathf.Pow(tParam, 3) * p3;

                transform.position = AirPosition;

                yield return(new WaitForEndOfFrame());
            }

            tParam = 0;

            routeToGo += 1;

            Debug.Log("Path: " + path + " Route: " + routeNumber + " Time: " + timer);
        }

        // Only switch to Phase 4 camera if Phase 3 (length of 66 seconds - 2 seconds pre-phase-3 transition) has passed.
        if (routeToGo > Path[path].childCount - 1 && sceneController.GetPhase() == 5)
        { ///was routes.Length still counts the number of routes
            routeToGo      = 0;
            path           = 1;
            vcam1.Priority = 0;
            vcam2.Priority = 1;
        }

        coroutineAllowed = true;

        // Switch to Airos camera
        if (routeToGo > Path[path].childCount - 1 && sceneController.GetPhase() == 6)
        {
            path           = 2;
            vcam3.Priority = 0;
            vcam4.Priority = 1;
            edge.enabled   = false;
            Debug.Log("Turning the smaller collider off.");
            coroutineAllowed = false;
        }
        else
        {
            coroutineAllowed = true;
        }
    }
Ejemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        // virtual camera priority switching

        // MATT!!!!MATT: "cameraPositionChange(1);" FOR THE CUTSCENES   MATT!!!!MATT

        //!!!
        //HONG  time values for when to switch the cameras
        //!!!

        timer += Time.deltaTime;
        if (PhaseN3)
        {
            subTimer += Time.deltaTime;
        }


        //IF THE PLAYER DIES AND CLICKS RETRY
        // CHANGE GET PHASE VALUE ON CUTSCENE IMPLEMENTED!
        if (Phase1_2 && sceneController.GetPhase() == 4) /// TRANSITION to GROUND PHASES
        {
            vcam_1_2.Priority = 0;
            vcam_Ground_Transition.Priority = 1;
            Phase1_2 = false;
            PhaseN3  = true; //transition
        }

        //GROUND_PHASE.CS TAKES OVER
        else if (PhaseN3 && subTimer > 2) //Phase 3 CAMERA ACTIVATE
        {
            vcam_Ground_Transition.Priority = 0;
            vcam_3.Priority = 1;
            PhaseN3         = false;
            Phase3_4        = true;
        }


        // Load checkpoint from Phase 4
        else if (sceneController.GetPhase() == 5)
        {
            vcam_1_2.Priority = 0;
            vcam_Ground_Transition.Priority = 0;
            vcam_3.Priority = 0;
            vcam_4.Priority = 1;
            Phase1_2        = false;
            PhaseN3         = false;
            Phase3_4        = true;
        }

        // BOSS TRANSITION
        if (vcam_4.Priority == 1 && Phase3_4 && sceneController.GetPhase() == 6) //***
        {
            Phase3_4        = false;
            PhaseNB         = true;
            vcam_4.Priority = 0;
            vcam_Boss_Transition.Priority = 1;
            timer = 0;
        }

        //AIROS CAMERAS

        else if (PhaseNB && timer > 2 && sceneController.GetPhase() == 6) //TRANSITION TO AIROS FIGHT
        {
            vcam_Boss_Transition.Priority = 0;
            vcam_Boss.Priority            = 1;
            PhaseNB = false;
            PhaseB  = true;


            // cameraPositionChange(1);
        }
    }
    // Update is called once per frame
    void Update()
    {
        timepassed  = Time.time;
        player      = GameObject.FindWithTag("ActivePlayer");
        progression = sceneControl.GetPhase();

        if (progression > 0 && GameObject.FindWithTag("IntroBlackCondor") != null)
        {
            GameObject.FindWithTag("IntroBlackCondor").SetActive(false);
        }

        if (introNeeded && progression == 0 && !introStarted)
        {
            player.GetComponent <Player>().SeizeMovement();
            introStarted = true;
        }

        isTutorialObjectiveDone = gameObject.GetComponent <Tutorial>().ObjectivesDone();

        if (timepassed - timestart > timeforintro && introNeeded)
        {
            if (player != null)
            {
                player.GetComponent <Player>().ReleaseMovement();
            }
            if (isTutorialObjectiveDone && !tutorialActivated)
            {
                StartTutorial();
            }
        }

        if (timepassed - timestart > timefortutorial + timeforintro && tutorialActivated && introNeeded)
        {
            tutorialComplete = true;
        }

        //Tutorial checks
        //player = GameObject.FindWithTag("ActivePlayer");

        //if (player.GetComponent<Animator>().GetBool("introcomplete")) EndTutorial();

        //Cutscene checks

        if (GameObject.FindWithTag("IntroCondor") != null && !condorIntroComplete)
        {
            StartCondorCutscene();
        }

        if (GameObject.FindWithTag("Lv1BlackCondor") != null && !condorFled)
        {
            StartCondorFlees();
        }

        if (timeEucalypsoAttack != -1 && timepassed - timeEucalypsoAttack > timeforEucalypso)
        {
            player.GetComponent <Player>().ReleaseMovement();
        }

        if (GameObject.FindWithTag("Airos") != null && !airosArrived)
        {
            StartAirosCutscene();
        }

        if (timeAirosIntro != -1 && timepassed - timeAirosIntro > timeforAiros && GameObject.FindWithTag("IntroAiros") != null)
        {
            GameObject.FindWithTag("IntroAiros").SetActive(false);
        }
    }