Skip to content

Companion Initialization Component

Maxwell Schroder edited this page Aug 31, 2023 · 2 revisions

Overview

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.

Usage

The usage of this method involves loading configurations, creating factory classes, and assembling the companion entity Properties

Constructor

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.

Methods

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. Screenshot 2023-08-31 at 1 11 16 PM

Components

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).

Clone this wiki locally