Hey!!
I'm making a game, and I need a life bar for my game.
When the player got the question correct, they'll get 2 points.
And when the player didn't get the question, the'll lose 3 points from they're points.
How can I do that??
And I want to start the game of life with 6 first.
Can some one PLEASE HELP ME??
Offline
You'll have to add a variable. I called it "life points" in the example below.
when gf clicked set [life points v] to [6] forever if < (answer) = [correct] > change [life points v] by [2] end if < (answer) = [wrong] > change [life points v] by [-3]
Offline
Add two variables, "life" and "question", then two lists, one for the questions, and the other one for the answers. But add the items to the lists in the same order.
when gf clicked set [life v] to (6) set [question v] to (1) repeat until <(question) = [ ]> //Must be filled with the number of questions. ask (item (question) of [question list v]) and wait if < (answer) = (item (question) of [answers v]) > change [life points v] by (2) say [Correct!] for (3) secs // You may remove this is you don't want it to say anything. else change [life points v] by (-3) say [Sorry, wrong answer.] for (3) secs // Same as the note above. end end Say (join [Your final score is: ] (life))
Last edited by NoxSpooth (2013-04-22 17:29:54)
Offline