I have created a game using XNA Game Studio. It consists of a square randomly moving anywhere and on clicking it, the score increases by one.
Now, what I want to do is, I want to end it after a time interval of, say, 100 seconds. So how do I do it? And where should I write that part of the code? That is, in which method? I am very new to XNA. Its just two days since I have started learning it.
In your update loop check the elapsed game time greater than 100 seconds:
If you want the total game time since the game started, you can use the
TotalGameTimeproperty instead, then you won’t need the counter.