So I am have made this 2D ball game. But I want to set a time limit for each level. I want player to play that level for maximum 3 minutes. After 3 minutes the game level should end. I have used allegro 5.0.10 with c++ .
How to achieve it? C'mon! I can use some help from c++ experts over here.
Otherwise create your own timer class and keep track of how much time has passed since the timer was started with https://www.allegro.cc/manual/5/al_get_time (You would set that to a variable as soon as you start the timer).
Making it last 3 minutes shouldn't be too hard with either of those.