Class ProjectileFactory

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

public class ProjectileFactory extends Object
Factory to create projectile entities like bombs, bullets, etc.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Entity
    createBomb(Entity source, com.badlogic.gdx.math.Vector2 spawnPosition, com.badlogic.gdx.math.Vector2 targetPosition, float explosionDelay, float explosionRadius, int damage)
    Creates a bomb entity that falls from source position toward target
    static Entity
    createProjectile(Entity source, com.badlogic.gdx.math.Vector2 direction, float speed, int damage)
    Creates a simple projectile (for potential future use)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createBomb

      public static Entity createBomb(Entity source, com.badlogic.gdx.math.Vector2 spawnPosition, com.badlogic.gdx.math.Vector2 targetPosition, float explosionDelay, float explosionRadius, int damage)
      Creates a bomb entity that falls from source position toward target
      Parameters:
      source - The entity that created the bomb (drone)
      spawnPosition - Position where bomb spawns (drone's position)
      targetPosition - Position where bomb should land (player's position)
      explosionDelay - Time in seconds before explosion after landing
      explosionRadius - Radius of explosion damage area
      damage - Damage the bomb will deal
      Returns:
      Bomb entity
    • createProjectile

      public static Entity createProjectile(Entity source, com.badlogic.gdx.math.Vector2 direction, float speed, int damage)
      Creates a simple projectile (for potential future use)
      Parameters:
      source - The entity that created the projectile
      direction - Direction the projectile should travel
      speed - Speed of the projectile
      damage - Damage the projectile deals
      Returns:
      Projectile entity