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 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 targetstatic Entity
createProjectile
(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 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 landingexplosionRadius
- Radius of explosion damage areadamage
- 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 projectiledirection
- Direction the projectile should travelspeed
- Speed of the projectiledamage
- Damage the projectile deals- Returns:
- Projectile entity
-