https://www.missiongaming17.co/2021/03/game-loop.html