title: How would i store a value from a constantly changing value and compare the stored one against the chaning one in C?
body: <p>So i'm trying to figure out how much Y a player has fallen in a game to then figure out how much damage should be taken. I'm doing this by trying to store the current y position of a player when they aren't on the ground, getting the new y position then subtracting the new position with the old one. Problem is oldy is always set to the current y and i don't know how to keep it separate. I don't have a lot of experience with C so any help would be appreciated</p>
  <pre><code>if (player-&gt;grounded==false){
  player-&gt;blocksfallen=player-&gt;position.y-player-&gt;oldy;
  player-&gt;oldy=player-&gt;position.y;
  } else {
      player-&gt;blocksfallen=0;
  }
  </code></pre>