-
-
Notifications
You must be signed in to change notification settings - Fork 4
Component
Brandon Dyer edited this page Dec 21, 2018
·
1 revision
Components hold the data that describes each entity. It is often used as a label to show possession of a given trait. Examples: position, velocity, rotation, mesh, transparency, mass, size, etc.
entity.AddComponent(new PositionComponent(x, y));class PositionComponent : public Component {
public:
// Data
Vec3 position;
// Constructor
PositionComponent(Vec3 position) : position(position){};
};entity.AddComponent(PositionComponent:New(x, y))