Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Point system? Help with variables.

$
0
0

Hello,

 

I am creating a basic simulation game which features 3 different "teachers" presenting information at a conference. The user selects a teacher and is presented with a question to answer. They are given 3 choices and can score 0, 1, or 2 points depending on the correctness of their choice.

 

I am working on displaying the scores on a results page. It should show the result for each of the 3 instructors and the total of their choices.

e.g. the screen says:

 

 

 

Reviewer Report:

Alex: 0/2 reviewer points

Bernice: 0/2 reviewer points

Carla: 0/2 reviewer points

 

Total score: 0/6


 

 

The 0s would update based on the points received through the game.

 

I have the variables displaying on the results page and will update as long as I hardcode in the variables so I know the code on the stage works, but I'm having trouble updating the variables based on the users progress through the game.

 

This is the code on the stage at compositionReady:

 

 

 

var alex_count = 0;

var bernice_count = 0;

var carla_count = 0;

var FinalScoreHolder = carla_count + bernice_count + alex_count;

 

sym.$("alex_count").html("ALEX: "+alex_count+"/2 reviewer points earned");

sym.$("bernice_count").html("BERNICE: "+bernice_count+"/2 reviewer points earned");

sym.$("carla_count").html("CARLA: "+carla_count+"/2 reviewer points earned");

sym.$("grade").html("Total Score: "+FinalScoreHolder+"/6");

 

 

 

Again, this part works and shows in textboxes on the screen in the report screen.

 

This code is on each of my choice buttons. Basically, the variables should update to these numbers for the score depending on if a certain choice is selected and then it will go play the corresponding scene. It's the same code on all of the buttons, but this is just taken from one option. The variables are not being updated to the report page.

 

 

 

if(currentLabel=="alex1"){

    sym.play("alex_ql");

    alex_count=0;

}

 

else if(currentLabel=="bernice1"){

    sym.play("bernice_ql");

    bernice_count=2;

}

 

else if(currentLabel=="carla1"){

    sym.play("carla_ql");

    carla_count=1;

}

 

 

 

 

Any suggestions or help would be appreciated. Thank you!


Viewing all articles
Browse latest Browse all 9897

Trending Articles