Class ProjectileFactory
java.lang.Object
com.csse3200.game.entities.factories.ProjectileFactory
Responsible for creating projectiles within the game.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntitycreateBaseProjectile(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a generic projectile entity that can be used for multiple types of * projectiles.static EntitycreateBossBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) static EntitycreateEffectProjectile(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, ProjectileEffects effect, boolean aoe) Creates a single-targeting projectile with specified effectstatic EntitycreateEngineerBullet(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a engineer bulletstatic EntitycreateFireBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a fireball Entity.static EntitycreateFireworks(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates new animation and fireballs for SplitFireworkComponent.static EntitycreateMobBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a projectile specifically for mobs to shootstatic EntitycreateMobBossBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a projectile to be used by the MobBossstatic EntitycreatePierceBallAnim(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) static EntitycreatePierceFireBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Create a pierce fireball.static EntitycreateRicochetFireball(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, int bounceCount) Create a ricochet fireball.static EntitycreateSplitFireWorksFireball(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, int amount) static voidsetColliderSize(Entity projectile, float x, float y) Sets the projectile collider so that the collider size can be altered for flexibility.
-
Method Details
-
createEffectProjectile
public static Entity createEffectProjectile(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, ProjectileEffects effect, boolean aoe) Creates a single-targeting projectile with specified effect- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.effect- Specified effect from the ProjectileEffects enums- Returns:
- Returns a new single-target projectile entity
-
createPierceFireBall
public static Entity createPierceFireBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Create a pierce fireball. Pierce fireball is basically a fireball that does damage but won't self destruct on hit. -
createRicochetFireball
public static Entity createRicochetFireball(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, int bounceCount) Create a ricochet fireball. Ricochet fireball bounces off specified targets while applying intended effects i.e. damage -
createSplitFireWorksFireball
public static Entity createSplitFireWorksFireball(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, int amount) -
createFireBall
public static Entity createFireBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a fireball Entity.- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.- Returns:
- Returns a new fireball projectile entity.
-
createFireworks
public static Entity createFireworks(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates new animation and fireballs for SplitFireworkComponent.- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.- Returns:
- Returns a new fireball projectile entity.
-
createPierceBallAnim
public static Entity createPierceBallAnim(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) -
createEngineerBullet
public static Entity createEngineerBullet(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a engineer bullet- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.- Returns:
- Returns a new fireball projectile entity.
-
createMobBall
public static Entity createMobBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a projectile specifically for mobs to shoot- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.- Returns:
- Returns a new fireball projectile entity.
-
createBossBall
public static Entity createBossBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) -
createMobBossBall
public static Entity createMobBossBall(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a projectile to be used by the MobBoss- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.- Returns:
- Returns a new fireball projectile entity.
-
createBaseProjectile
public static Entity createBaseProjectile(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a generic projectile entity that can be used for multiple types of * projectiles.- Parameters:
targetLayer- The enemy layer that the projectile collides with.destination- The destination the projectile heads towards.speed- The speed of the projectile.- Returns:
- Returns a generic projectile entity.
-
setColliderSize
Sets the projectile collider so that the collider size can be altered for flexibility.- Parameters:
projectile- Projectile's size collider to be scaled upon.x- Horizontal scaling of the collider in respect ot the size of the entityy- Veritcal scaling of the collider in respect to the size of the entity
-