Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Score counter help

Status
Not open for further replies.

martin359

Technical User
Apr 23, 2004
3
GB
I am making an interactive storybook/quiz for 10 year olds. The theme is Pokemon. As the story progresses the child encounters characters seen in the TV show and they are asked multiple choice questions about Pokemon. There will be 10 questions from each character after which they will give a score for their questions. At the end (after 3 sets of 10 questions) a total score is shown and this is used to "evolve" the player's Pokemon for the final battle. I need the counter to:

1) Add up the number of clicks in each set of 10 questions separately.

2) Create a final score that is the total of all sets of questions.

3) Then depending on the score one of three things happen: Pokemon does nothing, evolves to stage 1, or evolves to Stage 2.

So I need a way for the score to influence which parts of the story are played. Can anyone help please? Thanks
 
Use simple global variables, such as:
--
global gScoreSet1, gScoreSet2, gScoreSet3

on mouseUp me -- the correct answer button in the question set 2
gScoreSet2 = gScoreSet2 + 1
end mouseUp
--[/color blue]
To get the final score, add 3 scores of each set. Then decide what to do accordingly:
--
global gScoreSet1, gScoreSet2, gScoreSet3

totalScore = gScoreSet1 + gScoreSet2 + gScoreSet3

if totalScore < 5 then
nothing
else if totalScore < 15 then
evolveToStage(1)
else
evolveToStage(2)
end if
--[/color blue]

Something like that…!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top