Class ProjectileFactory
java.lang.Object
com.csse3200.game.entities.factories.ProjectileFactory
Responsible for creating projectiles within the game.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static Entity
createBossBall
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) 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 effectstatic Entity
createEngineerBullet
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a engineer bulletstatic Entity
createFireBall
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a fireball Entity.static Entity
createFireworks
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates new animation and fireballs for SplitFireworkComponent.static Entity
createMobBall
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a projectile specifically for mobs to shootstatic Entity
createMobBossBall
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Creates a projectile to be used by the MobBossstatic Entity
createPierceBallAnim
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) static Entity
createPierceFireBall
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed) Create a pierce fireball.static Entity
createRicochetFireball
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, int bounceCount) Create a ricochet fireball.static Entity
createSplitFireWorksFireball
(short targetLayer, com.badlogic.gdx.math.Vector2 destination, com.badlogic.gdx.math.Vector2 speed, int amount) static void
setColliderSize
(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
-