FAQ

Q) Why do we set the bee to inactive when it gets to -100? Why not just zero because zero is the left-hand side of the window?

A) The bee graphic is 60 pixels wide and its origin is at the top left pixel. So when the bee is drawn with its origin at x equals zero, the entire bee graphic is still on screen for the player to see. By waiting until it is at -100, we can be sure it is definitely out of the player's view.

Q) How do I know how fast my game loop is?

A) To measure this we will need to learn a few more things. We will add the ability to measure and display the current frame rate in Chapter 5: Collisions, Sound, and End Conditions - Making the Game Playable.

Get Beginning C++ Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.