Here are some more thoughts to complement the existing answer the existing answer.
Gaffer On Games has a great article on game loops that has been referenced everywhere.
Your game loop should have different independent stages: Input, Update, Render.
You could for example read inputs 30 times per second (or in real-time for better responsiveness), do 30 updates per second and render 60 frames per second, or whatever values work well for your game.
Here are some more thoughts to complement the existing answer.
Gaffer On Games has a great article on game loops that has been referenced everywhere.
Your game loop should have different independent stages: Input, Update, Render.
You could for example read inputs 30 times per second (or in real-time for better responsiveness), do 30 updates per second and render 60 frames per second, or whatever values work well for your game.
Here are some more thoughts to complement the existing answer.
Gaffer On Games has a great article on game loops that has been referenced everywhere.
Your game loop should have different independent stages: Input, Update, Render.
You could for example read inputs 30 times per second (or in real-time for better responsiveness), do 30 updates per second and render 60 frames per second, or whatever values work well for your game.
I Think you should listenHere are some more thoughts to the previous answer. And for anyone else who might fall on this question.
This is what is called a game loop problemcomplement the existing answer.
You can read up on this hereGaffer On Games has http://gafferongames.com/game-physics/fix-your-timestep/a great article on game loops . this website that has been referenced everywhere :).
In fact youYour game loop should have different independent stages to the game loop:
-Input -Update -Render Input, Update, Render.
Every stage should be indepedant of the other. You can have something likeYou could for example read inputs 30 Inputtimes per second(or in real-time input for better responsiveness), 30 Update do 30 updates per second. 60 and render 60 frames per second. <- (This seems like a waste, but usually uror whatever values work well for your game will look smoother)
Good Luck!.
I Think you should listen to the previous answer. And for anyone else who might fall on this question.
This is what is called a game loop problem.
You can read up on this here http://gafferongames.com/game-physics/fix-your-timestep/ . this website has been referenced everywhere :)
In fact you should have different stages to the game loop:
-Input -Update -Render
Every stage should be indepedant of the other. You can have something like 30 Input per second(or real-time input for better responsiveness), 30 Update per second. 60 render per second. <- (This seems like a waste, but usually ur game will look smoother)
Good Luck!
Here are some more thoughts to complement the existing answer.
Gaffer On Games has a great article on game loops that has been referenced everywhere.
Your game loop should have different independent stages: Input, Update, Render.
You could for example read inputs 30 times per second(or in real-time for better responsiveness), do 30 updates per second and render 60 frames per second, or whatever values work well for your game.
I Think you should listen to the previous answer. And for anyone else who might fall on this question.
This is what is called a game loop problem.
You can read up on this here http://gafferongames.com/game-physics/fix-your-timestep/. this website has been referenced everywhere :)
In fact you should have different stages to the game loop:
-Input -Update -Render
Every stage should be indepedant of the other. You can have something like 30 Input per second(or real-time input for better responsiveness), 30 Update per second. 60 render per second. <- (This seems like a waste, but usually ur game will look smoother)
Good Luck!