Linking time to score in a quiz game
Ive looked pretty hard through the forums, and tried to work out the expressions and values myself but its just not working.
What i want to be able to acheive is a few things.
1. Link a score to a time, ie if the user answers within 90 seconds they get 600 points and each second longer they take the score gets smaller for each question.
Say you took 90 seconds on the first question then youd get 600 points. if you took 80 seconds on the second question youd get 500 points and so on. if you answer with one second to spare you get 1 point.
The points are collated in a total and tallied at the end to show your total for the game.
Where is this data stored?
2.How can i link it to a database (mySQL) as i want to publish this game online. Ive seen the tutorial for the linking to SQL db which im yet to try, but it seems that you can only export in java for web when linking to DB, whereas i want to embed it, can anyone help or am i asking too much from this app?
3. Can i modify the buttons for next and previous etc or replace them with my own like have an active button that allows you to on click go to next page etc. Is there a book or manual re expressions and how to structure them?
Littlegong
Re: Linking time to score in a quiz game
OK so i will try to answer my own question.
If i did this it might work but i dont know the vairables to set.
Numbers are irrelevant and can use any number.
Always set alterable valueA of quiz question to 900
Set global value B to 10
Every second of the timer subtract global value b from alterable value A
Aanswer on page correct add XX to score.
I think that would work but im not sure what im doing wrong to get it to calculate.
AS im not a programmer i may be looking at this the wrong way, any guidence please???
Re: Linking time to score in a quiz game
1. I'm not sure about your question "Where is this data stored?", because you pretty much explained how to do everything. "Every Second: subtract 1 from Score" would be all that is needed, assuming you set the score to a high value at the start of the frame.
2. Why do you need to link to a database??
3. Yes, just use regular active objects and, under the Mouse object in the event editor, use "User clicks on object".
Re: Linking time to score in a quiz game
You don't need to always set alterable valueA to 900, that's probably why your subtraction of global value b from global value a isn't working.
Set valueA to 900 at the beginning of a question or when you start the timer. Setting it always, means always!
Re: Linking time to score in a quiz game
Ok Thanks for your input so far guys.
I guess i need to clarify one part of my question, that is i understand the concept of what needs to be done, but say in LB's example ("Every Second: subtract 1 from Score" would be all that is needed) is right, but i cant write it like that as an expression. What im struggling with is how to write the expressions and the like to add the value where required? is there some sort of expression and value dictionary i can consult?
Re: Linking time to score in a quiz game
I think you need to rephrase your question, as I do not understand why you would want to write that as an expression...
Re: Linking time to score in a quiz game
Create an Alt Variable called "PotentialPoints" and another called "PointsDelta". PotentialPoints is going to be used as the total number of points possible to get if you answer correctly at an moment. PointsDelta is the amount subtracted from PotentialPoints. Then you can use an expression like this:
+ When Timer is running (or whatever code signals the potential points to count down)
- Set PotentialPoints to (PotentialPoints - PointsDelta)
Is this what you are asking for?