Class ProjectileFactory
java.lang.Object
com.csse3200.game.entities.factories.ProjectileFactory
Factory to create non-playable projectile entities with predefined components.
Each projectile entity type has a creation method that returns a corresponding entity. Predefined entity properties can be loaded from configurations stored as JSON files defined in "NPCConfigs". This factory can be expanded or separated into more specific factories for entities with similar characteristics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createBanana
(Entity target) Creates a banana projectile entity (for monkey).static Entity
createElectricOrb
(Entity target) Creates an orb projectile entity (for eel).static Entity
createHive
(Entity target, List<Entity> enemies) Creates a hive enemy.static Entity
createWaterSpiral
(Entity target) static Entity
createWindGust
(Entity target) static Entity
createWorm
(Entity target) Creates an worm projectile entity (for eel).
-
Method Details
-
createBanana
Creates a banana projectile entity (for monkey).This projectile will chase the specified target entity, such as a player, using predefined AI tasks and animations.
- Parameters:
target
- The entity that the projectile will target and chase.- Returns:
- A new banana projectile entity.
-
createWaterSpiral
-
createWindGust
-
createElectricOrb
Creates an orb projectile entity (for eel).This projectile will chase the specified target entity, such as a player, using predefined AI tasks and animations.
- Parameters:
target
- The entity that the projectile will target and chase.- Returns:
- A new orb projectile entity.
-
createWorm
Creates an worm projectile entity (for eel).This projectile will chase the specified target entity, such as a player, using predefined AI tasks and animations.
- Parameters:
target
- The entity that the projectile will target and chase.- Returns:
- A new worm projectile entity.
-
createHive
Creates a hive enemy.- Parameters:
target
- entity which the spawned bees will chase- Returns:
- enemy hive entity
-