Ejemplo n.º 1
0
    public bool newHighScore(string name, int spot)
    {
        Save.ScorePair newPair = new Save.ScorePair(currentScore, name);
        Save.ScorePair oldPair;
        for (int i = spot; i < scoreList[currentLevel].Length; i++)
        {
            //Debug.Log("Old and new score");
            oldPair = scoreList[currentLevel][i];
            //Debug.Log(oldPair.name + " und " + oldPair.score);
            //Debug.Log(newPair.name + " und " + newPair.score);

            scoreList[currentLevel][i] = newPair;
            newPair = oldPair;
        }

        return(true);
    }
Ejemplo n.º 2
0
    /*
     * CreateSaveGameObject creates an empty Save object and overrides it's collectiblesGathered attribute with the current
     * ManagementSystem version
     *
     *@Katja
     */
    private Save CreateNewSaveGameObject()
    {
        Save save = new Save();

        collectiblesGathered = new List <int>();
        for (int i = 0; i < scoreList.Length; i++)
        {
            scoreList[i] = new Save.ScorePair[5];
            for (int j = 0; j < scoreList[i].Length; j++)
            {
                scoreList[i][j] = new Save.ScorePair(1000, "Player");
            }
        }
        save.collectiblesGathered = collectiblesGathered;
        save.currentLevel         = 0;
        save.scoreList            = scoreList;
        save.unlockedLevels       = 0;
        unlockedLevels            = save.unlockedLevels;
        currentLevel = 0;

        return(save);
    }