Cannot reduce speed to start speed

Basically I’m making a game where the player object (a ball) avoids some obstacles by jumping and such. When the game begins the ball accelerates to its MaxSpeed(a private var), which increases by 2 every 30 seconds, making the game a bit harder, but when the ball collides with the obstacle, the game should restart, reset the score, and reduce the MaxSpeed back to MaxSpeed1, which is the starting limit. While the first 2 things work, the last one doesn’t. Any ideas?
.
.
.

var MaxSpeed1:float=12;
private var MaxSpeed:float=MaxSpeed1;
.
.
.
if(Time.time-startTime>nextSpeedtime)
 {
 	MaxSpeed+=2.0;
 	nextSpeedtime+=speedPeriod;
 }
.
.
.
function OnCollisionEnter(col: Collision){
  if (col.transform.name == "zid"){
  
 	 MaxSpeed=MaxSpeed1;
  
   
    Application.LoadLevel(Application.loadedLevel);
    
    currentScore=0;
  }
  }

Note that everything works like a charm, apart from the “MaxSpeed=MaxSpeed1”

edit:I also tried doing something as simple as “MaxSpeed=12”, but it continues growing.

This is happening because Time.time measures time from the start of the game, not since the start of the level.

You need to add the lines

startTime = Time.time;
nextSpeedTime = startTime + speedPeriod;

At about line 16.

I solved the problem by putting the MaxSpeed=MaxSpeed1 line in the
if(Input.GetKeyDown(“right”))
{
//MaxSpeed=MaxSpeed1;
startTime=Time.time;
still=false;
rigidbody.useGravity=true;
}
which starts the game(movement) itself, although I’d still really like to know why the first one doesn’t work, it just doesn’t make sense to me, thank you in advance.