-
Notifications
You must be signed in to change notification settings - Fork 9
Companion Initialization Component
The CompanionFactory is a Java class that serves as a factory for creating companion entities within the game. It encapsulates the process of initialization and configuring companion entities. We chose the factory class initially because it is commonly used in the codebase, and suits the needs of a companion entity.
The usage of this method involves loading configurations, creating factory classes, and assembling the companion entity Properties
Java class 'CompanionConfig' to represent the configuration with extending BaseEntityConfig class of the companion entity . This class will serve as a blueprint for the entity's properties.
createCompanion(Entity playerEntity): Creates a new companion entity based on the provided playerEntity reference. This method assembles various components and configurations to form a fully functional companion entity.
The companion entity is highly similar to the player entity, and has several components: TextureRender, Physics, Hitbox, Collider, CombatStats, CompanionInventory, FollowComponent, and some companion specific ones (CompanionINteractionController and CompanionActions).
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files