Copy Contents of one Field to Another
Posted: Mon Aug 30, 2010 8:57 am
Hello again...
Yes, I'm stuck again.
My game now creates a list of words to show to the children to spell. As they spell a word correctly, that word is deleted from the list.
Here is the code for that part:
on RunGame
put 0 into gAttempts
get any word of field "TempList" of card "List Card"
put it into gWord
move field "word" to the loc of gButton in 1 tick
set the locktext of field "word" to true
put gWord into field "word"
show field "word"
wait 2 seconds
put empty into field "word"
set the locktext of field "word" to false
click at the loc of field "word"
end RunGame
on returnInField
put field "word" into tAnswer
--that is the word the students typed into the field, which is then compared to the original word
select empty
if tAnswer = gWord then
put yes into field "word"
hide button gButton
hide field "word" -- this with the above reveal a piece of the picture
replace gWord with empty in field "List 1" of card "List Card"
--removes the word from the list, but delets parts of other words that match as well!
I was using "any" because it seemed the easiest way to randomize the word selection but it looks like I will have to randomize a number and ask for a word by number instead, then after deleting that word, move up the other words and select a random number from 1-19 instead of from 1-20. It would be easier, however, if I could instead delete only whole words instead of parts of words.
Suggestions?
*sets out chocolate-chip cookies as a bribe*
Thanks,
Banty
Yes, I'm stuck again.
My game now creates a list of words to show to the children to spell. As they spell a word correctly, that word is deleted from the list.
Here is the code for that part:
on RunGame
put 0 into gAttempts
get any word of field "TempList" of card "List Card"
put it into gWord
move field "word" to the loc of gButton in 1 tick
set the locktext of field "word" to true
put gWord into field "word"
show field "word"
wait 2 seconds
put empty into field "word"
set the locktext of field "word" to false
click at the loc of field "word"
end RunGame
on returnInField
put field "word" into tAnswer
--that is the word the students typed into the field, which is then compared to the original word
select empty
if tAnswer = gWord then
put yes into field "word"
hide button gButton
hide field "word" -- this with the above reveal a piece of the picture
replace gWord with empty in field "List 1" of card "List Card"
--removes the word from the list, but delets parts of other words that match as well!
I was using "any" because it seemed the easiest way to randomize the word selection but it looks like I will have to randomize a number and ask for a word by number instead, then after deleting that word, move up the other words and select a random number from 1-19 instead of from 1-20. It would be easier, however, if I could instead delete only whole words instead of parts of words.
Suggestions?
*sets out chocolate-chip cookies as a bribe*
Thanks,
Banty