Hi,
I have created a simple Hangman Game where at the beginning of each game a word is picked at random from a list of words stored in a text box in the cast. What I want to do though is create a separate text box in the cast with a list of clue words with each word where a clue will be provided on the stage as to what the word the user has to guess could be at the beginning of each came. I guess I could do this by creating another text box with a list of words but put the clues on the same lines as they are in the words text box and then using lingo to look up that line in the clue words text box depending on wot word is chooses in the actual words text box. Below is the frame script that I'm using at the beginning of the game that chooses a word from the text box at random that the user has to guess at the beginning of the game:
global gHangmanWord
on exitFrame me
gHangmanWord = getHangmanWord()
letterList = []
repeat with x = 1 to gHangmanWord.char.count
letterList.add(gHangmanWord.char[x])
end repeat
sendAllSprites(#assignLetter, letterList)
end
on getHangmanWord
pickText = member("Hangman Words").text
howManyLines = pickText.line.count
repeat with x = howManyLines down to 1
if pickText.line[x] = "" then delete pickText.line[x]
end repeat
thisOne = random(howManyLines)
return pickText.line[thisOne]
end
Any help with this would be appreciated.
Thanks,
Darren
I have created a simple Hangman Game where at the beginning of each game a word is picked at random from a list of words stored in a text box in the cast. What I want to do though is create a separate text box in the cast with a list of clue words with each word where a clue will be provided on the stage as to what the word the user has to guess could be at the beginning of each came. I guess I could do this by creating another text box with a list of words but put the clues on the same lines as they are in the words text box and then using lingo to look up that line in the clue words text box depending on wot word is chooses in the actual words text box. Below is the frame script that I'm using at the beginning of the game that chooses a word from the text box at random that the user has to guess at the beginning of the game:
global gHangmanWord
on exitFrame me
gHangmanWord = getHangmanWord()
letterList = []
repeat with x = 1 to gHangmanWord.char.count
letterList.add(gHangmanWord.char[x])
end repeat
sendAllSprites(#assignLetter, letterList)
end
on getHangmanWord
pickText = member("Hangman Words").text
howManyLines = pickText.line.count
repeat with x = howManyLines down to 1
if pickText.line[x] = "" then delete pickText.line[x]
end repeat
thisOne = random(howManyLines)
return pickText.line[thisOne]
end
Any help with this would be appreciated.
Thanks,
Darren