Composing the Player
Learn how to compose a player and add it to the game world.
We'll cover the following...
Rather than coding everything player-related into a single module, the ECS approach describes a player in terms of what components they use. The Player
module from the previous lessons reveals some components that meet our needs:
-
A
Player
component indicates that the player is aPlayer
. Components needn’t contain any fields. An empty component is sometimes called a tag; it serves to flag that property exists. -
A
Render
component describing how the adventurer appears on the screen. -
A
Position
component indicates where they are on the map. The Point structure frombracket-lib
is ideal for this; it contains an ...