This is showing off the new UI layout for the algebra questions.

Feb 5th – Starting Algebra

Not much work has been done today; however, the groundwork for the algebra scene was initiated.

I had to go back and fix a couple spots in my code for the progress/leveling bar so that they are appropriate for their respective scenes.

[SerializeField] string scene;
if (scene.Equals("arithmetic")) playerLevel = (PlayerPrefs.GetInt("ArithmeticLvl"));
else if (scene.Equals("algebra")) playerLevel = (PlayerPrefs.GetInt("AlgebraLvl"));
The [serializeField] generates this box where I can manually input what scene we are in and therefore generate the right player level to display.

I also started working on problem generation. I did not do anything intensive so far I just wanted to set everything up so when I come back I can start to power through the coding.

// x+a=b => x=b-a
if(UnityEngine.Random.Range(0,101) > 50)
{
    int1 = UnityEngine.Random.Range(min, max+1);
    int2 = UnityEngine.Random.Range(min, max+1);
    ans = int2-int1;
    prompt.text = $"x+{int1}={int2}";
    Debug.Log("Problem ID: 1");
}

Final Notes

Coding did not take too much of my time and most of it was touching up my old code to now work more dynamically or abstractly, basically future-proofing it for when I add in more levels. I hope to get the next 2-3 tiers finished. I think there is a lot of problem variation I just wish I could make a LaTex for my game to have even more problems at my disposal.

Here is the working example of the version. I moved the streak alert to the top right so I can put in the algebraic equation for people to solve in the bottom left. It still feels out of place so I may change that later down the line.

Leave a Reply

Share :

Twitter
Telegram
WhatsApp