Boltgreywing
Senior Member
Now that I know which loop to use for the game why do people use this pattern? I am kind of confused as why input is separated from update and render in some cases and not combined.
Any one can explain this to me?
//This will be a working pong game.
//It will feature a single paddle, one ball, and three walls.
//It will be played from the left.
//The ball will increase in speed with each time it hits the paddle.
//There is only one life in this game.
//Points are recieved each time the ball hits a wall or the paddle itself.
//The object is to keep the ball above the paddle as long as possible.
//Newer version will have enemies and walls that will emerge from the right wall.
//They will try to attack the player but can only be defeated by the ball.
//Why this pattern for game development?
int main()
{
bool running = true;
do
{
//Input
//Update
//Render
}
while(running);
}
Any one can explain this to me?
//This will be a working pong game.
//It will feature a single paddle, one ball, and three walls.
//It will be played from the left.
//The ball will increase in speed with each time it hits the paddle.
//There is only one life in this game.
//Points are recieved each time the ball hits a wall or the paddle itself.
//The object is to keep the ball above the paddle as long as possible.
//Newer version will have enemies and walls that will emerge from the right wall.
//They will try to attack the player but can only be defeated by the ball.
//Why this pattern for game development?
int main()
{
bool running = true;
do
{
//Input
//Update
//Render
}
while(running);
}