I Need Help On My Eye Test Game
-
Hi, so I've been working on a game for a while now, and it's had a lot of improvements. But I still need help because there's glitches and bugs. I probably have less coding experience then most of you and that's why I need help. So, here's all I need help with. (You'd understand a lot easier if you played the game. 😊) 1: Whenever you type in a word even if it's not the word that's on the screen both times, (2: It makes you type it twice ðŸ˜) it'll say you got it right. 😟
Also feel free to give reviews on my game from replying! 😃 (Please be nice) Here's the ID!
ID: 1VU33MND1Q -
Hi TurtleGamer! Very nice game idea! I think both problems can be solved by editing line 90, currently
if answer == input("What does it say?") then
to
if answer == answer[num] then
so that it's checking against the random selection you made before. With input() there, you're getting a second, new input from the player, which will always be 'true' so it counts it as correct. Hope that makes sense. You'll also need to change line 110, either to check against "Cloud" as you have printed a few lines above, or changing
num
to a new random number before printing, then repeating the code from the first question. -
@kat So basically you want me to change line 90, and after the first question, change num to a new number and make a new word list for question 2? (If that makes sense)
-
@TurtleGamer-0 You won't need a new word list, just the line
num = random(50)
after the first question, yes :) You'll need to change lines 108 and 110 as well so that it prints and checks the newanswer[num]
. -
@kat I thiiiiink I did everything you said but if I get it right or wrong it always shows an error message :(
-
@turtlegamer-0 What does the message say?
-
@kat there was an error on line 90 and the error code says: "String index out of bounds. (String index length: 6, index: 17)" I have no idea what it's trying to say 😓
-
@turtlegamer-0 Ah ok, there's something I didn't spot. Both your array of answers and the variable that stores the player's response are both named "answer" and that's giving you the problem. Try changing lines 89 and 90 to say something like
playerAnswer = input( "What does it say?" ) if playerAnswer == answer[num] then