Example #1
0
    public void showScores()
    {
        StaticLevelState.changeState(3);

        if (!System.IO.File.Exists(Application.persistentDataPath + "/scores"))
        {
            scores = new Scores();
        }
        else
        {
            scores = FileManager.ReadFromBinaryFile <Scores> (Application.persistentDataPath + "/scores");
        }

        scoresPanel.SetActive(true);

        for (int i = 0; i < scores.getScores().Count; i++)
        {
            namesText.text += scores.getScores() [i].Key + "\r\n";
        }

        for (int i = 0; i < scores.getScores().Count; i++)
        {
            scoresText.text += scores.getScores()[i].Value.ToString("0.00") + "m" + "\r\n";
        }

        FileManager.WriteToBinaryFile(Application.persistentDataPath + "/scores", scores);
    }
Example #2
0
    public void killPlayer()
    {
        Health             = 0;
        isDead             = true;
        playerCurrentSpeed = 0f;

        setPlayerHorizontalSpeed(0);

        anim.SetTrigger("dead");
        //Debug.Log("die");

        SoundController.instance.stopMusic();
        SoundController.instance.playMusic(music.player_death, false);
        // play dead animation

        StaticLevelState.changeState(2);
    }
Example #3
0
 public void showMenuWithoutRestart()
 {
     StaticLevelState.changeState(0);
 }
Example #4
0
 public void showMenu()
 {
     StaticLevelState.changeState(0);
     SceneManager.LoadScene("ImpossibleFeupPrototype");
 }
Example #5
0
 public void startGame()
 {
     StaticLevelState.changeState(1);
     SoundController.instance.playMusic(music.bossfight_commando_steve, true);
 }
Example #6
0
 public void restartGame()
 {
     StaticLevelState.changeState(1);
     SceneManager.LoadScene("ImpossibleFeupPrototype");
 }