Esempio n. 1
0
    void SubmitEntry()
    {
        string submission = entry.GetString();

        if (previousSubmissions.Contains(submission))    // repeat entry
        {
            //entry.DramaticallySubmit(submission.Length, fizzle: true);
            entry.DramaticallyClear();
            puzzle.FreeAllLetters();
            Chain = 1;
            Debug.Log("Repeat: chain reset");
        }
        else                                                    // new entry
        {
            if (dm.IsAnagramOf(submission, puzzle.GetString())) // success!
            {
                int thisScore = ScoreSubmission(submission);
                Score += thisScore;
                previousSubmissions.Add(submission);
                entry.DramaticallySubmit(thisScore);
                puzzle.FreeAllLetters();
                bool foundQuestWord = qtm.RevealWord(submission);

                if (foundQuestWord)
                {
                    // play the arpeggio
                    sfx.PlayArp();
                }
                else
                {
                    // play a note

                    sfx.PlayScaleNote(Mathf.Min(Chain, 8));
                }
            }
            else                                                //nope
            {
                entry.DramaticallyClear();
                puzzle.FreeAllLetters();
                Chain = 1;
                Debug.Log("Non-anagram: chain reset");
            }
        }
    }