Summary

Upon completing this chapter, we've successfully moved away from inheritance-based entity design and reinforced our code-base with a much more modular approach, thus avoiding many pitfalls that composition leaves behind. A chain is only as strong as its weakest link, and now we can rest assured that the entity segment will hold.

In the next two chapters, we will be discussing how to make the game more interactive and user friendly by adding a GUI system, as well as adding a few different types of elements, managing their events and providing room for them to be graphically customizable. See you there!

Get SFML Game Development By Example 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.