Skip to content

Projectiles

fireProjectiles(npc, position, velocity, projectilesMode?, projectileParams?): readonly EntityProjectile[]

Defined in: packages/isaacscript-common/src/functions/projectiles.ts:26

Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).

Use this function instead of the EntityNPC.FireProjectiles method if you need to modify or access the EntityProjectile objects after they are fired, since this function returns the objects in an array.

EntityNPC | undefined

The NPC to fire the projectile(s) from. You can also pass undefined if you do not want the projectile(s) to come from anything in particular.

Vector

The staring position of the projectile(s).

Vector

The starting velocity of the projectile(s).

ProjectilesMode = ProjectilesMode.ONE_PROJECTILE

Optional. The mode of the projectile(s). Default is ProjectilesMode.ONE_PROJECTILE.

ProjectileParams = ...

Optional. The parameters of the projectile(s). Default is ProjectileParams().

readonly EntityProjectile[]

The fired projectile(s).


fireProjectilesInCircle(npc, position, speed, numProjectiles): readonly EntityProjectile[]

Defined in: packages/isaacscript-common/src/functions/projectiles.ts:65

Helper function to spawn projectiles in a circle around a position. Under the hood, this leverages ProjectileMode.N_PROJECTILES_IN_CIRCLE.

EntityNPC | undefined

The NPC to fire the projectile(s) from. You can also pass undefined if you do not want the projectile(s) to come from anything in particular.

Vector

The staring position of the projectile(s).

float

The speed of the projectile(s).

int

The amount of projectiles to spawn.

readonly EntityProjectile[]

The fired projectile(s).