private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         SceneEngine.PopScene();
     }
 }
Beispiel #2
0
    public void SelectLevel(int level)
    {
        GameData._instance.setPlaying(true);
        switch (level)
        {
        case 0:
            SceneEngine.PopScene();
            break;

        case 1:
            SceneEngine.PushScene(SceneEngine.Scenes.SPRING);
            break;

        case 2:
            SceneEngine.PushScene(SceneEngine.Scenes.SUMMER);
            break;

        case 3:
            SceneEngine.PushScene(SceneEngine.Scenes.FALL);
            break;

        case 4:
            SceneEngine.PushScene(SceneEngine.Scenes.WINTER);
            break;
        }
    }
Beispiel #3
0
    IEnumerator death()
    {
        GameData._instance.setPlaying(false);
        yield return(new WaitForSeconds(.05f));

        if (!SceneEngine.PeekStack().Equals(SceneEngine.Scenes.WINTER))
        {
            GameData._instance.playerProfile.progressLevels();
        }
        else
        {
            Debug.LogWarning("No more levels to beat!");
        }
        SceneEngine.PopScene();
        Destroy(this.gameObject);
    }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (Time.timeScale != 0.0)
            {
                Time.timeScale = 0.0f;
                pauseOverlay.SetActive(true);
            }
            else
            {
                Time.timeScale = 1.0f;
                pauseOverlay.SetActive(false);
            }
        }
        if (Input.GetKeyDown(KeyCode.Backspace) && Time.timeScale == 0.0f)
        {
            SceneEngine.PopScene();
        }

        if ((deathDetect > 0) & (lives > 0) & (playerManager.isKillable))
        {
            float      xpos  = initialspawnPos.GetComponent <Transform>().position.x;
            float      ypos  = initialspawnPos.GetComponent <Transform>().position.y;
            Vector3    pos   = new Vector3(xpos, ypos, -10f);
            Quaternion angle = Quaternion.Euler(0f, 0f, 0f);

            if (lives > 0)
            {
                Instantiate(playerPrefab, pos, angle);
                deathDetect -= 1;
                lives        = lives - 1;
            }
        }

        if (lives <= 0 && deathDetect == 1)
        {
            StartCoroutine("trueDeath");
        }

        pointCounter.GetComponent <UnityEngine.UI.Text>().text = points.ToString();
        lifeCounter.GetComponent <UnityEngine.UI.Text>().text  = lives.ToString();
        grazeCounter.GetComponent <UnityEngine.UI.Text>().text = graze.ToString();
        bombCounter.GetComponent <UnityEngine.UI.Text>().text  = bombs.ToString();
    }
Beispiel #5
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         SceneEngine.PopScene();
     }
     else if (Input.anyKeyDown)
     {
         for (int i = 0; i < 5; i++)
         {
             if (Input.GetMouseButtonDown(i))
             {
                 return;
             }
         }
         if (currentSplash == Splashes.Length - 1)
         {
             SceneEngine.PushScene(SceneEngine.Scenes.MENU);
         }
         Splashes[currentSplash].color = new Color(0, 0, 0, 0);
         currentSplash++;
         hitFullView = false;
     }
 }
    public IEnumerator trueDeath()
    {
        yield return(new WaitForSeconds(5f));

        SceneEngine.PopScene();
    }
Beispiel #7
0
    IEnumerator gameOver()
    {
        yield return(new WaitForSeconds(5f));

        SceneEngine.PopScene();
    }