Boltgreywing
Senior Member
I am looking to understand which of these loops would work in a game loop design strategy. What are the advantages and disadvantages of each approach?
//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.
//Which of these ones should I use?
//Choice A:
for( ;
{
}
//Choice B:
while(true)
{
}
//Choice C:
do
{
}
while(true);
//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.
//Which of these ones should I use?
//Choice A:
for( ;
{
}
//Choice B:
while(true)
{
}
//Choice C:
do
{
}
while(true);