So i followed this neat tutorial on making a time counter. But now a problem has appeared.
The timer will start when the game starts, meaning it will count from 0 and up, starting at the menus. For example, when i start the first level from the menu, 15 seconds have already passed by.
So i need a way to trigger the timer only when a specific layout has been initiated.
The game will have several levels, as well as seperate high score tables, so in the end i'll need a way to have seperate timers, connected to each level, and a way to stop the timer when the end of a level has been reached, as well as the ability to store it to a value.
*Edit: I'll also need a feature that halts/pauses the timer for x seconds when the player collides with an object (when picking up an item).
Anyone done anything similar? Or have any tips on how i can achieve this?
Any help is appreciated!