Within video games, it's rarely a good idea to have continuous actions, such as movement, use a static value every frame. For instance, we have our cycle moving 0.1 units per frame, so if our frame rate is 60, the cycle will move 6 units per second. If our frame rate is 30, our cycle will move 3 units per second. What we want is to have our cycle move at a constant speed, regardless of the frame rate. We can achieve that by using delta time.
Delta time means change in time. In our case, delta time will be the change in time from the last frame to the current frame. We can get delta time from the
globalClock object using the method
DirectStart creates the
globalClock object for us, so we don't need to worry ...