Class ProjectileFactory

java.lang.Object
com.csse3200.game.entities.factories.ProjectileFactory

public class ProjectileFactory extends Object
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 Details

    • createSlingShot

      public static Entity createSlingShot(int damage, float speed)
      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 entity
      speed - the speed the sling shot moves at
      Returns:
      entity representing a sling shot projectile