I’m trying to make a game like Typeracer. Of course, most of it will involve string manipulation and using some rich text to produce similar effects, shown by images below:
My problem is that I’m not sure how to make the code for this, so that when a player types a word correctly, the word will be turned to green and the next word is underlined.
I could be way off, but assuming you know the basics, (if not there are tutorials), you may be able to use TextBoxFocused to check when they’re typing and then check until the Text = the target text and time it.
you would split the string you want to type in the text box by every character, and you would check to see if the characters match. if they do, make it green, and add + 1 to words typed. if they don’t, make it red and maybe you could add + 1 to a mistake counter?
To calculate the formula, you can do: take the number of entries (characters) and divide by five to get the number of words typed. examples: if you typed 200 characters in 1 minute, your speed would be (200 characters / 5) / 1 min = **40 . if you typed 200 characters in 30 seconds your net speed would be (200/5) / 0.5 = 80