Time-based movement question
<p>I am reading about time-based movement, but I can't seem to fully understand what's going on.
In the game, I have this code:</p>

<p>About the deltaTime:</p>

<pre><code>long startTime = System.nanoTime();

while(running)
// some code here
float deltaTime = (System.nanotime()-startTime) / 1000000000.f;
startTime = System.nanoTime();
// more code here
</code></pre>

<p>In the framework implementation:</p>

<pre><code>float tickTime = 0
static float tick = 0.5f;

//update method() {

tickTime += deltaTime;

while (tickTime &gt; tick) {
// do some stuff
</code></pre>

<p>What I am trying to do is to move my character every 0.5 seconds. I don't know what we check in the while loop, or why we add deltaTime to tickTime (the original coder said something about accumulating). Please also give me an example of deltaTime's value.</p>

<p>I am not sure if I forgot to mention something. Thank you very much!</p>
