Summary
In this chapter, we have achieved a lot. We have coded a sound-related class that also plays music in a loop, and we have coded a class that handles all the game logic and encapsulated it in a GameObject
that runs once per loop of the game loop.
We have coded the beginning of a playable character using a graphics component and an update component composed within a game object. This is the essence of the Entity Component system. This process will be repeated for every type of entity in our game.
We have continued coding the factory, which is responsible for assembling all the different game objects and sharing the appropriate data between them.
In the next chapter, we will focus on graphics and drawing by coding CameraGraphics
and CameraUpdate
classes that are also derived from Graphics
and Update
.