my project has to do with a math problem. I am trying tirelessly for a script that help me advance to the next screen once the correct answer is picked. Please shed some wisdom!
Offline
If <(answer) = (correct)> broadcast [problem (whatever) v] // as many broadcasts as there are problems.And then...
When i receive [problem (x) v] //for the backround, or backround sprite switch to costume [(x)] // or [i]switch to backround[/i]I hope I helped!
Last edited by mythbusteranimator (2012-05-17 13:29:40)
Offline
A better one one (it involve a list, but has less broadcasts] would be
when gf clicked set [nextanswer v] to 1 forever if <(answer) = (questionanswer)> broadcast [answerright v] end end when I receive [answerright v] next costume change [nextanswer v] by 1 set [questionanswer v] to (item (nextanswer) of [answers v])you'd need a list with all the answers in but that's about it
Offline
Let's say there is 2 problems, 1+1 and 1+2. try:
(Sprite 1
when gf clicked add [2] to [answers list v] add [3] to [answers list v] repeat until <<answer> = <item (1 v) of [answers list v] ask [What is 1+1?] and wait if <<answer> = <item (1 v) of [answers list v]>> broadcast [1=correct v] and wait end repeat until <<answer> = <item (2 v) of [answers list v] ask [What is 1+2?] and wait if <<answer> = <item (2 v) of [answers list v]>> broadcast [2=correct v] and wait end(Stage:)
when gf clicked switch to background [question 1 v] when I receive [1=correct v] switch to background [question 2 v] when I receive [2=correct v] switch to background [congrats! you won! v]
Offline