Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (gameStart && !secondLoopStarted)
        {
            //When the game has started, if the intro is done playing loop the seocnd part forever
            if (!BGmusicSource.isPlaying)
            {
                BGloopsource.Play();
                secondLoopStarted = true;
            }
        }

        if (!GetComponent <PickupsAndStats>().Alive)        //when Robo dies
        {
            //hud.SetActive(false);
            resultsHUD.SetActive(true);
            ThrowBtn.SetActive(false);
            JumpBtn.SetActive(false);
            LeftBtn.SetActive(false);
            RightBtn.SetActive(false);
            // instance.ShowBanner();

            //Fade the music out
            StartCoroutine(FadeOut(BGmusicSource, 3.5f));
            StartCoroutine(FadeOut(BGloopsource, 3.5f));
        }
        if (GetComponent <PickupsAndStats>().Alive)
        {
            //instance.HideBanner();
        }
    }
Beispiel #2
0
 public void Begin()
 {
     GameStart = true;
     hud.SetActive(true);
     MainMenu.SetActive(false);
     ThrowBtn.SetActive(true);
     JumpBtn.SetActive(true);
     LeftBtn.SetActive(true);
     RightBtn.SetActive(true);
     //BGmusicSource.Play();
     //instance.HideBanner();
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     BGmusicSource.clip = BGmusic; //sets up the music
     BGloopsource.clip  = BGloop;  //BGloop is what loops after the intro is done
     hud.SetActive(true);
     ThrowBtn.SetActive(false);
     JumpBtn.SetActive(false);
     LeftBtn.SetActive(false);
     RightBtn.SetActive(false);
     resultsHUD.SetActive(false);
     //load the game stats when starting scene over
     LoadGame();
 }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     hasDied = false;
     spr     = gameObject.GetComponent <SpriteRenderer>();
     if (!hasSaved)
     {
         initPos  = gameObject.transform.position;
         startPos = initPos;
     }
     else if (SceneManager.GetActiveScene().name == "SampleScene")
     {
         gameObject.transform.position = startPos;
     }
     singleJoyStick = FindObjectOfType <SingleJoystick>();
     jumpBtn        = FindObjectOfType <JumpBtn>();
     PA             = gameObject.GetComponent <PlayerAnimation>();
 }