Class ProjectileFactory
java.lang.Object
com.csse3200.game.entities.factories.ProjectileFactory
Factory class for creating projectile entities for defense entities (e.g., sling shoots for sling
shooters). This class should not be instantiated — all methods and configuration are static
utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createSlingShot
(int damage, float speed) Creates a sling shot projectile entity.
-
Method Details
-
createSlingShot
Creates a sling shot projectile entity.The sling shot is designed to be used by defense entities such as sling shooters. It includes components for physics, collision, attack damage, and rendering. The projectile is set to deal damage to enemies and is destroyed upon impact.
- Parameters:
damage
- amount of damage dealt to an enemy entityspeed
- the speed the sling shot moves at- Returns:
- entity representing a sling shot projectile
-