I have a multiple choice quiz game, and i want to make score. however i want to connect the score with my time renaming therefore if user chooses the right answer he get's 10 points but i also want to multiply that number with the time remaining. so if the time reaches 0 the game ends if he finishes fast he get's higher score, and if he finishes so slow he will lose score. to to summarize i want the time remaining and the points to be connected together.
What i have tried is, on each correct answer i pass in a point and i made it score and also i have a high score, what i can't figure out is how to connect it to the time remaining?
Here's what i have
public void AnswerButtonClick(bool isCorrect)
{
if (isCorrect)
{
Debug.Log("I'm Correct");
theAnswerIsCorrect = true;
playerScore += currentRoundData.pointAddedForCorrectAnswer;
scoreDisplayText.text = "Score: " + playerScore.ToString();
}
else
theAnswerIsCorrect = false;
// Do we still have questions?
if (questionPool.Length > questionIndex + 1)
{
//questionIndex++;
UpdateQuestionIndex();
StartCoroutine(DelayTime(3));
// ShowQuestion();
}
else
{
EndRound();
}
}
This just add's point if i get the correct answer, what i need is how do also calculate the time remaining with my points.
Here's the time remaining
// Update is called once per frame
void Update ()
{
if (isRoundActive)
{
timerRemaing -= Time.deltaTime;
UpdateTimeRemainingDisplay();
if (timerRemaing <= 0)
EndRound();
}
}
so basically everytime my time is getting lower i lose more score. Thank you