Class ProjectileFactory
java.lang.Object
com.csse3200.game.entities.factories.ProjectileFactory
Factory to create projectile entities like bombs, bullets, etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntitycreateBomb(Entity source, com.badlogic.gdx.math.Vector2 spawnCenter, com.badlogic.gdx.math.Vector2 targetPosition, float explosionDelay, float explosionRadius, int damage) Creates a bomb entity that falls from source position toward targetstatic EntitycreateLaserProjectile(Entity source, com.badlogic.gdx.math.Vector2 spawnPos, com.badlogic.gdx.math.Vector2 direction, float speed, int damage) Creates a laser pulse projectile entitystatic EntitycreateProjectile(Entity source, com.badlogic.gdx.math.Vector2 direction, float speed, int damage) Creates a simple projectile (for potential future use)
-
Method Details
-
createBomb
public static Entity createBomb(Entity source, com.badlogic.gdx.math.Vector2 spawnCenter, 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)spawnCenter- Position where bomb spawns (drone's position)targetPosition- Position where bomb should land (player's position)explosionDelay- Time in seconds before explosion after landingexplosionRadius- Radius of explosion damage areadamage- Damage the bomb will deal- Returns:
- Bomb entity
-
createLaserProjectile
public static Entity createLaserProjectile(Entity source, com.badlogic.gdx.math.Vector2 spawnPos, com.badlogic.gdx.math.Vector2 direction, float speed, int damage) Creates a laser pulse projectile entity- Parameters:
source- The entity that created the projectile (boss)spawnPos- Position where projectile spawns (CENTER position)direction- Direction the projectile should travel (normalized)speed- Speed of the projectiledamage- Damage the projectile deals- Returns:
- Laser projectile 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 projectiledirection- Direction the projectile should travelspeed- Speed of the projectiledamage- Damage the projectile deals- Returns:
- Projectile entity
-