BaseEntity
Last updated
Last updated
The BaseEntity property controls the inheritance of a given Entity. An Entity can inherit from another Entity, or it can inherit from a FlatRedBall type, like Sprite.
Entities can inherit from other Entities. Entity inheritance is the current recommended approach for creating a variety of common entities, such as multiple Enemy types in a game. To do this:
Click on the Add Entity quick action
Use the Base Entity dropdown to select the base entity. Note that when a Base Entity is selected, most of the options are hidden since the new entity inherits those properties from its base.
Click OK
The new entity now inherits from the selected Base Entity.
A new entity can be created as a derived entity in the new entity window.
Entities can inherit from FlatRedBall types, such as Sprites. By default Entities inherit from PositionedObject, but this inheritance can be modified through Glue. The reason this feature exists is primarily to improve performance and reduce memory consumption. For more information, see the Inheriting from FlatRedBall Types tutorial.