Chapter 20: Game Objects and Components
In this chapter, we will be doing all the coding related to the Entity-Component pattern we discussed at the beginning of the previous chapter. This means we will code the base Component
class, which all the other components will be derived from. We will also put our new knowledge of smart pointers to good use so that we don't have to concern ourselves with keeping track of the memory we allocate for these components. We will also code the GameObject
class in this chapter.
We will cover the following topics in this chapter:
- Preparing to code the components
- Coding the Component base class
- Coding the collider components
- Coding the graphics components
- Coding the update components
- Coding the GameObject class
Let's discuss the components a bit more before we start coding. Please note that, in this chapter, I will try and reinforce how the Entity-Component system fits together and how all the components...