PyGame Basics: An Improved Game Loop
In this guide, we will be creating a PyGame game loop with delta time. Using delta time can be very useful in keeping the movement of your game smoother. Essentially with a delta time based game loop, game objects will appear to move at a constant speed even when the frame rate changes. Something like the following is common for a PyGame game loop: self.clock.tick(self.fps) while not self.done: self.update() self.render() To convert this game loop to utilize delta time, change the above code to the following:...