Original Post
Can someone please explain the concept of a game loop to me? I am really slow on this kind of stuff.
I am really trying to understand the concepts of game update and draw. And frames per second.
A frame is like a picture yeah? So if I flip through many frames I can get something like an animation. I think the recommended is 60fps?
Right now, all I have is
So anytime the loop is run input is required, then the changes - if any - are applied to the game objects, maybe they changed position screen. The backbuffer is cleared to reflect later change of positions or whatever.
But the thing is..what is the number of frames in this case? I haven't set any number..so I assume the number of frames is how fast the while loop can run depending on the computer?
If I was to introduce the concept of frames per second how would I do it? I can't find tutorials on this. I am using C++ thanks.
NB: Can you please make explanations simple. Think of it like explaining to a 2 year old .
I am really trying to understand the concepts of game update and draw. And frames per second.
A frame is like a picture yeah? So if I flip through many frames I can get something like an animation. I think the recommended is 60fps?
Right now, all I have is
while(!keypressed)
{
input
draw
clearsprite
}
So anytime the loop is run input is required, then the changes - if any - are applied to the game objects, maybe they changed position screen. The backbuffer is cleared to reflect later change of positions or whatever.
But the thing is..what is the number of frames in this case? I haven't set any number..so I assume the number of frames is how fast the while loop can run depending on the computer?
If I was to introduce the concept of frames per second how would I do it? I can't find tutorials on this. I am using C++ thanks.
NB: Can you please make explanations simple. Think of it like explaining to a 2 year old .