Beispiel #1
0
    void Update()
    {
        if (ScreenChanger.GetScreen() != ScreenState.DungeonScreen)
        {
            return;
        }

        if (Input.GetKey(KeyCode.RightAlt))
        {
            LevelGenerator.Camera.transform.position = new Vector3(22.5f, 50.0f, 22.5f);
        }

        if (Input.GetKeyUp(KeyCode.P))
        {
            AudioSource.clip = PauseGame;
            AudioSource.Play();
            ScreenChanger.SetScreen(ScreenState.PauseScreen);
        }

        if (Input.GetKeyUp(KeyCode.Space) && Adventurer.IsOnStairs() && Adventurer.GetKeyFound() && LevelGenerator.GetFloorNumber() < 13)
        {
            AudioSource.clip = OpenDoor;
            AudioSource.Play();
            ScreenChanger.SetScreen(ScreenState.TransitionScreen);
        }

        if (Adventurer.GetLight() == 0)
        {
            if (ScreenChanger.GetScreen() == ScreenState.DungeonScreen)
            {
                AudioSource.clip = Died;
                AudioSource.Play();
            }

            ScreenChanger.SetScreen(ScreenState.DeathScreen);
        }

        if (Input.GetKeyUp(KeyCode.Space) && Adventurer.IsOnStairs() && Adventurer.GetKeyFound() && LevelGenerator.GetFloorNumber() == 13)
        {
            if (ScreenChanger.GetScreen() == ScreenState.DungeonScreen)
            {
                AudioSource.clip = Fanfare;
                AudioSource.Play();
            }

            ScreenChanger.SetScreen(ScreenState.VictoryScreen);
        }

        Adventurer.MoveAdventurer();
        Adventurer.HaveFoundOilCan();
        Adventurer.HaveFoundKey();

        if (Specter.HaveFoundAdventurer() == true)
        {
            if (!GetHasPlayed())
            {
                AudioSource.clip = Scream;
                AudioSource.Play();
                SetHasPlayed(true);
            }
            LevelGenerator.SetAdventurerLocation(new GridLocation(LevelGenerator.StairsUpLocation.GetX(), LevelGenerator.StairsUpLocation.GetZ()), Quaternion.identity);
        }
    }