Hi, I am trying to implement a pause for my pong game. I was wondering how you go about doing it. I tried already and I've been having problems. Anyways this is an abstraction of my game loop right now
While (user hasn’t quit)
{ Read input
If user quits,
Quit game
Handle user input
Computer AI
Check Collisions
Check for scoring
Update positions on sprites
Render sprites
Control Framerate
}
What I've been trying to do to make a pause is this:
While (user hasn’t quit)
{ do
Read input
If user quits,
Quit game
Handle user input
while ( game is paused and user hasn't quit)
Computer AI
Check Collisions
Check for scoring
Update positions on sprites
Render sprites
Control Framerate
}
Is this the right direction? or am I going about this wrong?