Projectiles
Functions
fireProjectiles
▸ fireProjectiles(npc
, position
, velocity
, projectilesMode?
, projectileParams?
): readonly EntityProjectile
[]
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.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
npc | undefined | 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. |
position | Vector | undefined | The staring position of the projectile(s). |
velocity | Vector | undefined | The starting velocity of the projectile(s). |
projectilesMode | ProjectilesMode | ProjectilesMode.ONE_PROJECTILE | Optional. The mode of the projectile(s). Default is ProjectilesMode.ONE_PROJECTILE . |
projectileParams | ProjectileParams | undefined | Optional. The parameters of the projectile(s). Default is ProjectileParams() . |
Returns
readonly EntityProjectile
[]
The fired projectile(s).
Defined in
packages/isaacscript-common/src/functions/projectiles.ts:26
fireProjectilesInCircle
▸ fireProjectilesInCircle(npc
, position
, speed
, numProjectiles
): readonly EntityProjectile
[]
Helper function to spawn projectiles in a circle around a position. Under the hood, this
leverages ProjectileMode.N_PROJECTILES_IN_CIRCLE
.
Parameters
Name | Type | Description |
---|---|---|
npc | undefined | EntityNPC | 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. |
position | Vector | The staring position of the projectile(s). |
speed | float | The speed of the projectile(s). |
numProjectiles | int | The amount of projectiles to spawn. |
Returns
readonly EntityProjectile
[]
The fired projectile(s).