What you want to do is keep track of how much time passes between frames and update the game world by that much. Think of it like a physics simulation if that helps.