I need a time bonus to be added to the score at the end of the level. I understand what needs to be done, just not quite how to do it.
Using this code, when I reach the end of the level it starts adding points forever, whizzing up extremely fast. I think its because its adding the remaining time but somehow still using Time.deltaTime in some way.
I seperated the code into an extra function (addUp) in an effort to move some of the code out of the Update in case that was the problem, but I must have done the wrong thing as it didnt change
var score : int;
var timer : float = 60;
function Update()
{
timer -= Time.deltaTime;
}
//then some code to determine if the end level prerequisites have been met, if so run the addUp function (this bit is in the update too).
function addUp()
{
var bonus = timer *2;
score = score+bonus;
}