title: Pause unpause while keeping the same values of variables?
body: <p>I am learning to make games using <strong>SDL</strong> and <strong>C++</strong>. </p>
  
  <p>I use <strong>time-based movement</strong> not frame rate.
  My player moves right/left and when I press space it changes direction. </p>
  
  <p>Now if I pause the game by </p>
  
  <ul>
  <li>minimizing it on windows</li>
  <li>pressing the HOME button on my Phone (Android)</li>
  <li>or close the screen also on phone</li>
  </ul>
  
  <p>the timer doesn't pause. 
  ( <strong>SDL_GetTicks()</strong> doesn't stop) and my player continues to move.</p>
  
  <p>When the player touches the "walls" or "enemies" they die and the game is over. 
  This happens every time when I pause the game.</p>
  
  <ul>
  <li>How can I solve this problem? </li>
  <li>How can my variables ( ex. : positions of different sprites/objects) maintain their values when I pause the game for X seconds and then unpause it later?</li>
  </ul>
  
  <p>Please leave as much of a detailed explanation as you can and I would be really appreciative.</p>