Ok, I am making a math game with these numbers depicted. And there are three different sprites, each with different costumes for all 9 questions. And they are labeled AnswerA, AmswerB, and AnswerC. But I am wondering how I do the different questions, I know I would need to add a question variable, but how can I write each question and have it change every time when I click the right arrow? And how do I program the sprite to be correct/incorrect with multiple questions?
1. 2 – AnswerB
2. 7 – AnswerA
3. 16 – AnswerB
4. 23 – AnswerC
5. 29 – AnswerA
6. 32 – AnswerB
7. 40 – AnswerB
8. 60 – AnswerC
9. 99 – AnswerA
Offline
Here's my current brain dump:
Make these global variables:
(question) (right)and this variable in each sprite:
(selection)and in the three sprites:
When I receive [next v] show when [AnswerA] clicked// this is the "spriteclicked" hat block set [selection v] to [a]//different for each sprite broadcast [check v] hidein a common sprite, or the stage:
when gf clicked set [question v] to (1) set [right v] to (0) broadcast [next v] when I receive [check v] if <(item (question) of [answers v]) = (selection)> say [right answer] for (1) secs change [right v] by (1) else say [wrong answer] for (1) secs end if <(question) < [9]> change [question v] by (1) broadcast [next v] else say (join (join [Game over. You got ] (right) ) [ answers of 9 right.]) endDon't forget to make the list with the answers (a, b, or c) in the right order, etc.
Last edited by thebriculator (2012-12-02 22:53:06)
Offline
hclarson wrote:
and how can you put an individual variable, like selection into a common script on the stage like in your example?
Under the sensing tab, you should see a block like this about 13 blocks down:
([x position v] of [sprite3 v])Then, change the second drop down to the sprite you want, and under the first drop down menu, select what you want. You can choose the sprite's x position, y position, and local variables, just to name a few.
Offline
hclarson wrote:
Hey, if I uploaded my unfinished game with what I think is actually correct, then could someone help me figure out what is wrong?
Thanks
Of course we can. As long as I (or some other helpful scratcher) has access to a computer, then we'll help as much as needed.
Offline