GML - Time to complete level
From Global Programming Syntax
For this code, we will asume you are putting the code in obj_player which is the object the player is. This will only work in GM7 and as ust a note, 30 is the default number of steps per second.
Example Code
In the Create Event, put the following:
alarm[0]=30 // Change 30 to number of steps per second.
globalvar timer, timerend;
timer=0;
timerend=0;
Now put the following GML in the 'Alarm 0' event.
timer+=1;
if timerend=0 then
{
timer[0]=30; // Change 30 to number of steps per second.
}
Now, providing that your scores are being displayed in a different room, put the following GML in the 'room end' event.
timerend=1;
// If you want it in minutes, add the following GML below the above line.
timer=timer/60;
timer=round(timer);
