O'Reilly logo

SFML Blueprints by Maxime Barbier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building an entity system

First of all, what is an entity system?

An entity system is a design pattern that focuses on data. Instead of creating a complex hierarchical tree of all possible entities, the idea is to build a system that allows us to add components to an entity at runtime. These components could be anything such as health points, artificial intelligence, skin, weapon, and everything but data.

However, if none of the entities and components hold functionalities, where are they stored? The answer is in the systems. Each system manages at least one component, and all the logic is inside these systems. Moreover, it is not possible to build an entity directly. You have to create or update it using an entity manager. It will be in charge ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required