Ejemplo n.º 1
0
    IEnumerator CutsceneCoroutine()
    {
        Debug.Log("player has started talking");
        Statics.SetPlayerControl(false, this); // revoke control from player

        yield return(null);                    //wait until player releases Q

        for (int i = 0; i < bubbles.Length; ++i)
        {
            bubbles[i].transform.position = attachPoints[i].position;
            bubbles[i].transform.rotation = attachPoints[i].rotation;
            bubbles[i].transform.parent   = attachPoints[i];
            bubbles[i].GetComponent <Renderer>().enabled = true; // makes bubble visible
            while (!Input.GetKeyDown(proceedKey))                //wait until user proceeds
            {
                yield return(null);
            }

            yield return(null);

            bubbles[i].GetComponent <Renderer>().enabled = false; // makes bubble invisible
        }

        Debug.Log("player has finished talking");
        Statics.SetPlayerControl(true, this); // return control to player
        currentlyConversing = false;
        TutorialSharedMethods.SpawnBubble(interactBubble, ThoughtBubblePoint);
        bubbleSpawned = true;
        onConversationEnd.Invoke();
    }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         TutorialSharedMethods.SpawnBubble(interactBubble, thoughtBubblePoint);
         bubbleSpawned = true;
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (!dropTutorialFinished && collision.gameObject.tag == "Player")
     {
         TutorialSharedMethods.SpawnBubble(dropThoughtBubble, thoughtBubblePoint);
         dropBubbleSpawned = true;
         ManageDropTutorial();
     }
 }
Ejemplo n.º 4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         canConverse = true;
         TutorialSharedMethods.SpawnBubble(interactBubble, ThoughtBubblePoint);
         bubbleSpawned = true;
     }
 }
Ejemplo n.º 5
0
 void ManageDropTutorial()
 {
     //wait for drop tutorial delay
     if (dropTutorialTimer < dropTutorialDelay)
     {
         dropTutorialTimer += Time.deltaTime;
         return;
     }
     //after tutorial delay, spawn the bubble only once
     if (!dropBubbleSpawned)
     {
         TutorialSharedMethods.SpawnBubble(dropThoughtBubble, thoughtBubblePoint);
         dropBubbleSpawned = true;
     }
     //see if the player has interacted enough
     if (!PlayerHasDroppedEnough())
     {
         return;
     }
     //when they have jumped enough, end the tutorial
     TutorialSharedMethods.DestroyBubble(dropThoughtBubble);
     dropTutorialFinished = true;
 }
Ejemplo n.º 6
0
    //------------------------------------------------------------------------------
    // Methods for the JUMP tutorial
    //------------------------------------------------------------------------------

    void ManageJumpTutorial()
    {
        //wait for push tutorial delay
        if (jumpTutorialTimer < jumpTutorialDelay)
        {
            jumpTutorialTimer += Time.deltaTime;                //this will take longer than the moveTutorialDelay because it isn't incremented first
            return;
        }
        //after tutorial delay, spawn the bubble only once
        if (!jumpBubbleSpawned)
        {
            TutorialSharedMethods.SpawnBubble(jumpThoughtBubble, thoughtBubblePoint);
            jumpBubbleSpawned = true;
        }
        //see if the player has jumped enough
        if (!PlayerHasJumpedEnough())
        {
            return;
        }
        //when they have jumped enough, end the tutorial
        TutorialSharedMethods.DestroyBubble(jumpThoughtBubble);
        jumpTutorialFinished = true;
    }
Ejemplo n.º 7
0
    //------------------------------------------------------------------------------
    // Methods for the PUSH tutorial
    //------------------------------------------------------------------------------

    void ManagePushTutorial()
    {
        //wait for push tutorial delay
        if (pushTutorialTimer < pushTutorialDelay)
        {
            pushTutorialTimer += Time.deltaTime;                //this will take longer than the moveTutorialDelay because it isn't incremented first
            return;
        }
        //after tutorial delay, spawn the bubble only once
        if (!pushBubbleSpawned)
        {
            TutorialSharedMethods.SpawnBubble(pushThoughtBubble, thoughtBubblePoint);
            pushBubbleSpawned = true;
        }
        //see if the player has pushed enough - enough is when one of the blocks is in a geyser
        if (!PlayerHasPushedEnough())
        {
            return;
        }
        //when they have pushed enough, end the tutorial
        TutorialSharedMethods.DestroyBubble(pushThoughtBubble);
        pushTutorialFinished = true;
    }
Ejemplo n.º 8
0
    //------------------------------------------------------------------------------
    // Methods for the MOVEMENT tutorial
    //------------------------------------------------------------------------------

    void ManageMoveTutorial()
    {
        //wait for move tutorial delay
        if (moveTutorialTimer < moveTutorialDelay)
        {
            moveTutorialTimer += Time.deltaTime;                //this will take longer than the moveTutorialDelay because it isn't incremented first
            return;
        }
        //after tutorial delay, spawn the bubble only once
        if (!moveBubbleSpawned)
        {
            TutorialSharedMethods.SpawnBubble(moveThoughtBubble, thoughtBubblePoint);
            moveBubbleSpawned = true;
        }
        //keep track of how much the player has moved
        if (!PlayerHasMovedEnough())
        {
            return;
        }
        //when they have moved enough, end the tutorial
        TutorialSharedMethods.DestroyBubble(moveThoughtBubble);
        moveTutorialFinished = true;
    }