Forum Moderators: not2easy
For example… I want the user to input a the word “grass” in the text box …then when they press an enter button the text box clears where the user can put another word in the text box…then another…
Basically the process will go on like this:
1- User inputs “Grass” in text box
2- User presses an ENTER button
3- Text box clears
Then I want this process to repeat until the user inputs ten word….
At the end of it the user presses an “analyze” button where the 10 words entered are all compared to the ten words I embedded… it will give the result of the testing game.
I am good as far as graphics goes in director and have designed this simple game, but I have no idea about Lingo scripts… so please help me if you can because I don’t know what the lingo scripts I would have to use to achieve this.
thanks in advance
on beginsprite me
myCounter = 0 -- init counter so we can count how many wordshave been entered
set masterWordList = ["word1","word2,"andSoOn"] -- init master word list
set userWordList = [] -- init empty user word list, we will put the words entered by the user into this list
end
on mouseup me
theWord = member("textbox").text
userWordList.append(theWord) -- add word to userWordList
member("textbox").text = "" -- clear text box
if myCounter > 9 -- check to see how many words have been entered. if more than 9, analyze()
analyze()
else
myCounter = myCounter + 1 -- increase mycounter
end
end
on analyze
userScore = 0
repeat with foo = 1 to 10
if getAt(userWordList,foo) == (getAt masterWordList, foo)
userScore = userScore +1
end
end repeat
myCounter = 0 -- reset counter
end
hope that helps, or at least gets you in the right direct. if you are new to lingo you might need to bone up on lists and the repeat structure. good luck