Ejemplo n.º 1
0
    public Scores(WordOptions.Difficulty sessionDifficulty)
    {
        lifetimeScores = new Dictionary<WordOptions.Difficulty, List<float>>();
        lifetimeAverages = new Dictionary<WordOptions.Difficulty, List<float>>();

        foreach(WordOptions.Difficulty difficulty in WordOptions.Difficulty.GetValues(typeof(WordOptions.Difficulty))) {
            lifetimeScores.Add(difficulty, new List<float>());
            lifetimeAverages.Add(difficulty, new List<float>());

            for(int i=0; i<ScoreHistory; i++){
                if( PlayerPrefs.HasKey(LifetimeScoreName(difficulty, i)) ) {
                    lifetimeScores[difficulty].Add(PlayerPrefs.GetFloat(LifetimeScoreName(difficulty, i)));
                }

                if( PlayerPrefs.HasKey(LifetimeAverageName(difficulty, i)) ) {
                    lifetimeAverages[difficulty].Add(PlayerPrefs.GetFloat(LifetimeAverageName(difficulty, i)));
                }
            }
        }

        this.sessionDifficulty = sessionDifficulty;
        lastScoreImpact = 0;
        sessionScore = 0;
        sessionAverage = 0;
        sessionCount = 0;
    }
Ejemplo n.º 2
0
    public Instructions(WordOptions.Difficulty difficulty, float lastScoreImpact, float sessionScore, float sessionAverage)
    {
        BackStyle = new GUIStyle();
        BackStyle.fontSize = Main.FontLarge;
        BackStyle.normal.textColor = Colors.ClickableText;
        BackStyle.alignment = TextAnchor.MiddleCenter;

        NextWordStyle = new GUIStyle();
        NextWordStyle.fontSize = Main.FontLargest;
        NextWordStyle.normal.textColor = Colors.ClickableText;
        NextWordStyle.alignment = TextAnchor.MiddleCenter;

        SessionScoreStyle = new GUIStyle();
        SessionScoreStyle.fontSize = Main.FontLarge;
        SessionScoreStyle.normal.textColor = Colors.ReadableText;
        SessionScoreStyle.alignment = TextAnchor.MiddleRight;

        SessionScoreLabelStyle = new GUIStyle();
        SessionScoreLabelStyle.fontSize = Main.FontLarge;
        SessionScoreLabelStyle.normal.textColor = Colors.ReadableText;
        SessionScoreLabelStyle.alignment = TextAnchor.MiddleLeft;

        // InstructionsStyle = new GUIStyle();
        // InstructionsStyle.fontSize = Main.FontLarge;
        // InstructionsStyle.normal.textColor = Colors.ReadableText;
        // InstructionsStyle.alignment = TextAnchor.MiddleCenter;
        // InstructionsStyle.wordWrap = true;

        BackRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - (((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) + (Main.NativeWidth * 0.05f)), (Main.NativeWidth / 3) - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        BeginRect = new Rect(Main.NativeWidth * 0.05f, (Main.NativeHeight / 2f) - (Main.NativeHeight / 16f), Main.NativeWidth - (Main.NativeWidth * 0.1f), Main.NativeHeight / 8f);
        // InstructionsRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeWidth * 0.05f, Main.NativeWidth - (Main.NativeWidth * 0.1f), Main.NativeHeight - (Main.NativeWidth * 0.1f));
        SessionScoreRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - (((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionAverageRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 2) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        // PhaseScoreImpactRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 3) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionScoreLabelRect = new Rect(Main.NativeWidth * 0.5f, Main.NativeHeight - (((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionAverageLabelRect = new Rect(Main.NativeWidth * 0.5f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 2) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        // PhaseScoreImpactLabelRect = new Rect(Main.NativeWidth * 0.5f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 3) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));

        this.difficulty = difficulty;
        // this.lastScoreImpact = lastScoreImpact;
        this.sessionScore = sessionScore;
        this.sessionAverage = sessionAverage;
    }
Ejemplo n.º 3
0
    public GameScreen(WordOptions.Difficulty difficulty)
    {
        BackStyle = new GUIStyle();
        BackStyle.fontSize = Main.FontLarge;
        BackStyle.normal.textColor = Colors.ClickableText;
        BackStyle.alignment = TextAnchor.MiddleCenter;

        OptionStyle = new GUIStyle();
        OptionStyle.fontSize = Main.FontLargest;
        OptionStyle.normal.textColor = Colors.ClickableText;
        OptionStyle.alignment = TextAnchor.MiddleCenter;

        SessionScoreStyle = new GUIStyle();
        SessionScoreStyle.fontSize = Main.FontLarge;
        SessionScoreStyle.normal.textColor = Colors.ReadableText;
        SessionScoreStyle.alignment = TextAnchor.MiddleRight;

        SessionScoreLabelStyle = new GUIStyle();
        SessionScoreLabelStyle.fontSize = Main.FontLarge;
        SessionScoreLabelStyle.normal.textColor = Colors.ReadableText;
        SessionScoreLabelStyle.alignment = TextAnchor.MiddleLeft;

        ScoreCorrectSpriteStyle = new GUIStyle();
        ScoreCorrectSpriteStyle.fontSize = Main.FontLargest;
        ScoreCorrectSpriteStyle.normal.textColor = Colors.BrightGreen;
        ScoreCorrectSpriteStyle.alignment = TextAnchor.MiddleCenter;

        ScoreIncorrectSpriteStyle = new GUIStyle();
        ScoreIncorrectSpriteStyle.fontSize = Main.FontLargest;
        ScoreIncorrectSpriteStyle.normal.textColor = Colors.BrightRed;
        ScoreIncorrectSpriteStyle.alignment = TextAnchor.MiddleCenter;

        BackRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - (((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) + (Main.NativeWidth * 0.05f)), (Main.NativeWidth / 3) - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionScoreRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - (((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionAverageRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 2) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        // WordScoreImpactRect = new Rect(Main.NativeWidth * 0.05f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 3) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionScoreLabelRect = new Rect(Main.NativeWidth * 0.5f, Main.NativeHeight - (((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        SessionAverageLabelRect = new Rect(Main.NativeWidth * 0.5f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 2) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));
        // WordScoreImpactLabelRect = new Rect(Main.NativeWidth * 0.5f, Main.NativeHeight - ((((Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f)) * 3) + (Main.NativeWidth * 0.05f)), Main.NativeWidth - (Main.NativeWidth * 0.1f), (Main.NativeHeight / 12f) - (Main.NativeWidth * 0.05f));

        ScoreSpriteEndLocation = new Vector2(SessionScoreRect.x + (SessionScoreRect.width * 0.9f), SessionScoreRect.y + (SessionScoreRect.height / 2f));

        this.difficulty = difficulty;

        score = new Scores(this.difficulty);

        active = true;

        resetSession();
        resetWord();
        sessionLowerBoundsTime = Time.time;
    }