diff --git a/docs/classes/Bullet.html b/docs/classes/Bullet.html index 3a74c83..768bdce 100644 --- a/docs/classes/Bullet.html +++ b/docs/classes/Bullet.html @@ -2,7 +2,7 @@

Bullets are used by the Weapon class, and are normal Sprites, with a few extra properties in the data manager to handle Weapon specific features.

-

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Bullet(scene: Scene, x: number, y: number, key: string, frame: string | number): Bullet
  • Parameters

    • scene: Scene

      A reference to the currently running scene.

    • x: number

      The x coordinate (in world space) to position the Bullet at.

      @@ -59,7 +59,7 @@ on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these reasons try to be careful about the construction of your Scene and the frequency of which blend modes are used.

      -

body

body: Body
+

body

body: Body

This Bullet's Physics Body.

cameraFilter

cameraFilter: number

A bitmask that controls if this Game Object is drawn by a Camera or not. @@ -134,7 +134,7 @@

Does this Game Object have a tint applied?

It checks to see if the 4 tint properties are set to the value 0xffffff and that the tintFill property is false. This indicates that a Game Object isn't tinted.

-

Optional lifespan

lifespan?: number
+

Optional lifespan

lifespan?: number

If you've set Weapon.bulletKillType to KILL_LIFESPAN this property contains the lifespan the Bullets have set on launch. The value is given in milliseconds. When a Bullet hits its lifespan limit it will be automatically killed.

@@ -408,7 +408,7 @@ The returned point is calculated in local space and does not factor in any parent containers

Type parameters

Parameters

  • Optional output: O

    An object to store the values in. If not provided a new Vector2 will be created.

    -

Returns O

getData

  • getData(key: "timeEvent"): undefined | TimerEvent
  • getData(key: "bulletManager"): undefined | Weapon
  • getData(key: "fromX"): number
  • getData(key: "fromY"): number
  • getData(key: "bodyDirty"): boolean
  • getData(key: "rotateToVelocity"): boolean
  • getData(key: "killType"): KillType
  • getData(key: "killDistance"): number
  • getData(key: "bodyBounds"): Rectangle
  • Parameters

    • key: "timeEvent"

    Returns undefined | TimerEvent

  • Parameters

    • key: "bulletManager"

    Returns undefined | Weapon

  • Parameters

    • key: "fromX"

    Returns number

  • Parameters

    • key: "fromY"

    Returns number

  • Parameters

    • key: "bodyDirty"

    Returns boolean

  • Parameters

    • key: "rotateToVelocity"

    Returns boolean

  • Parameters

    • key: "killType"

    Returns KillType

  • Parameters

    • key: "killDistance"

    Returns number

  • Parameters

    • key: "bodyBounds"

    Returns Rectangle

getIndexList

  • getIndexList(): number[]
  • +

Returns O

getData

  • getData(key: "timeEvent"): undefined | TimerEvent
  • getData(key: "bulletManager"): undefined | Weapon
  • getData(key: "fromX"): number
  • getData(key: "fromY"): number
  • getData(key: "bodyDirty"): boolean
  • getData(key: "rotateToVelocity"): boolean
  • getData(key: "killType"): KillType
  • getData(key: "killDistance"): number
  • getData(key: "bodyBounds"): Rectangle
  • Parameters

    • key: "timeEvent"

    Returns undefined | TimerEvent

  • Parameters

    • key: "bulletManager"

    Returns undefined | Weapon

  • Parameters

    • key: "fromX"

    Returns number

  • Parameters

    • key: "fromY"

    Returns number

  • Parameters

    • key: "bodyDirty"

    Returns boolean

  • Parameters

    • key: "rotateToVelocity"

    Returns boolean

  • Parameters

    • key: "killType"

    Returns KillType

  • Parameters

    • key: "killDistance"

    Returns number

  • Parameters

    • key: "bodyBounds"

    Returns Rectangle

getIndexList

  • getIndexList(): number[]
  • Returns an array containing the display list index of either this Game Object, or if it has one, its parent Container. It then iterates up through all of the parent containers until it hits the root of the display list (which is index 0 in the returned array).

    @@ -498,10 +498,11 @@

    This should only be called during the instantiation of the Game Object. After that, use setPipeline.

    Parameters

    • pipeline: string | WebGLPipeline

      Either the string-based name of the pipeline, or a pipeline instance to set.

      -

    Returns boolean

kill

Returns boolean

kill

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol
      @@ -629,7 +630,7 @@

      The current timestamp.

    • delta: number

      The delta time, in ms, elapsed since the last frame.

      -

    Returns void

prepare

  • prepare(x: number, y: number): void

Returns void

prepare

  • prepare(x: number, y: number): void
  • Prepares this bullet to be fired and to interact with the rest of the scene again.

    Parameters

    • x: number
      @@ -764,7 +765,7 @@

      The width of the crop rectangle in pixels.

    • Optional height: number

      The height of the crop rectangle in pixels.

      -

    Returns Bullet

setData

  • setData(key: Partial<BulletData>, data?: undefined): Bullet
  • setData(key: "timeEvent", data: undefined | TimerEvent): Bullet
  • setData(key: "bulletManager", data: undefined | Weapon): Bullet
  • setData(key: "fromX", data: number): Bullet
  • setData(key: "fromY", data: number): Bullet
  • setData(key: "bodyDirty", data: boolean): Bullet
  • setData(key: "rotateToVelocity", data: boolean): Bullet
  • setData(key: "killType", data: KillType): Bullet
  • setData(key: "killDistance", data: number): Bullet
  • setData(key: "bodyBounds", data: Rectangle): Bullet
  • Parameters

    • key: Partial<BulletData>
    • Optional data: undefined

    Returns Bullet

  • Parameters

    Returns Bullet

  • Parameters

    • key: "bulletManager"
    • data: undefined | Weapon

    Returns Bullet

  • Parameters

    • key: "fromX"
    • data: number

    Returns Bullet

  • Parameters

    • key: "fromY"
    • data: number

    Returns Bullet

  • Parameters

    • key: "bodyDirty"
    • data: boolean

    Returns Bullet

  • Parameters

    • key: "rotateToVelocity"
    • data: boolean

    Returns Bullet

  • Parameters

    Returns Bullet

  • Parameters

    • key: "killDistance"
    • data: number

    Returns Bullet

  • Parameters

    Returns Bullet

setDataEnabled

  • +

Returns Bullet

setData

  • setData(key: Partial<BulletData>, data?: undefined): Bullet
  • setData(key: "timeEvent", data: undefined | TimerEvent): Bullet
  • setData(key: "bulletManager", data: undefined | Weapon): Bullet
  • setData(key: "fromX", data: number): Bullet
  • setData(key: "fromY", data: number): Bullet
  • setData(key: "bodyDirty", data: boolean): Bullet
  • setData(key: "rotateToVelocity", data: boolean): Bullet
  • setData(key: "killType", data: KillType): Bullet
  • setData(key: "killDistance", data: number): Bullet
  • setData(key: "bodyBounds", data: Rectangle): Bullet
  • Parameters

    • key: Partial<BulletData>
    • Optional data: undefined

    Returns Bullet

  • Parameters

    Returns Bullet

  • Parameters

    • key: "bulletManager"
    • data: undefined | Weapon

    Returns Bullet

  • Parameters

    • key: "fromX"
    • data: number

    Returns Bullet

  • Parameters

    • key: "fromY"
    • data: number

    Returns Bullet

  • Parameters

    • key: "bodyDirty"
    • data: boolean

    Returns Bullet

  • Parameters

    • key: "rotateToVelocity"
    • data: boolean

    Returns Bullet

  • Parameters

    Returns Bullet

  • Parameters

    • key: "killDistance"
    • data: number

    Returns Bullet

  • Parameters

    Returns Bullet

setDataEnabled

  • Adds a Data Manager component to this Game Object.

    Returns Bullet

setDepth

  • setDepth(value: number): Bullet
  • The depth of this Game Object within the Scene.

    @@ -1094,7 +1095,7 @@ If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

    Returns Bullet

toggleFlipY

  • Toggles the vertical flipped state of this Game Object.

    -

    Returns Bullet

update

  • update(): void

update

  • update(): void
  • Updates the Bullet, killing as required.

    Returns void

updateDisplayOrigin

  • Updates the Display Origin cached values internally stored on this Game Object. diff --git a/docs/classes/Weapon.html b/docs/classes/Weapon.html index b3e2736..c3ee14d 100644 --- a/docs/classes/Weapon.html +++ b/docs/classes/Weapon.html @@ -15,7 +15,7 @@ Phaser.Scene.create method:

    var weapon = this.add.weapon(10, 'bullet');
    weapon.fireFrom.setPosition(300, 300);
    this.input.on(Phaser.Input.Events.POINTER_DOWN, weapon.fire, this);
    -

Hierarchy

Index

Constructors

constructor

  • new Weapon(scene: Scene, bulletLimit?: number, key?: string, frame?: string, group?: Group): Weapon

Hierarchy

Index

Constructors

constructor

  • new Weapon(scene: Scene, bulletLimit?: number, key?: string, frame?: string, group?: Group): Weapon
  • Parameters

    • scene: Scene

      A reference to the Phaser.Scene instance.

    • Optional bulletLimit: number

      The quantity of bullets to seed the Weapon with. If -1 it will set the pool to automatically expand.

      @@ -25,151 +25,151 @@

      If the Sprite image contains multiple frames you can specify which one to use here.

    • Optional group: Group

      Optional Group to add the object to.

      -

    Returns Weapon

Properties

debugPhysics

debugPhysics: boolean = false
+

Returns Weapon

Properties

debugPhysics

debugPhysics: boolean = false

Should debug graphics render for physics bodies?

-

logLevel

logLevel: "warn" | "error" | "off" = 'warn'
+

logLevel

logLevel: "warn" | "error" | "off" = 'warn'

Log level for this weapon. Either warn, error or off. warn is the default. If you change this, please do so before setting any other properties.

-

scene

scene: Scene
+

scene

scene: Scene

The scene the Weapon is bound to

-

Accessors

autoExpandBulletsGroup

  • get autoExpandBulletsGroup(): boolean
  • set autoExpandBulletsGroup(value: boolean): void

Accessors

autoExpandBulletsGroup

  • get autoExpandBulletsGroup(): boolean
  • set autoExpandBulletsGroup(value: boolean): void
  • Should the bullet pool run out of bullets (i.e. they are all in flight) then this boolean controls if the Group will create a brand new bullet object or not.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • Should the bullet pool run out of bullets (i.e. they are all in flight) then this boolean controls if the Group will create a brand new bullet object or not.

    -

    Parameters

    • value: boolean

    Returns void

autofire

  • get autofire(): boolean
  • set autofire(value: boolean): void

autofire

  • get autofire(): boolean
  • set autofire(value: boolean): void
  • Will this weapon auto fire? If set to true then a new bullet will be fired based on the fireRate value.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • Will this weapon auto fire? If set to true then a new bullet will be fired based on the fireRate value.

    -

    Parameters

    • value: boolean

    Returns void

bounds

bounds

  • This Rectangle defines the bounds that are used when determining if a Bullet should be killed or not. It's used in combination with bulletKillType when that is set to either KILL_WEAPON_BOUNDS or KILL_STATIC_BOUNDS. If you are not using either of these kill types then the bounds are ignored. If you are tracking a Sprite or Point then the bounds are centered on that object every frame.

    -

    Returns Rectangle

  • +

    Returns Rectangle

  • This Rectangle defines the bounds that are used when determining if a Bullet should be killed or not. It's used in combination with bulletKillType when that is set to either KILL_WEAPON_BOUNDS or KILL_STATIC_BOUNDS. If you are not using either of these kill types then the bounds are ignored. If you are tracking a Sprite or Point then the bounds are centered on that object every frame.

    -

    Parameters

    Returns void

bulletAngleOffset

  • get bulletAngleOffset(): number
  • set bulletAngleOffset(value: number): void

bulletAngleOffset

  • get bulletAngleOffset(): number
  • set bulletAngleOffset(value: number): void
  • An optional angle offset applied to the Bullets when they are launched. This is useful if for example your bullet sprites have been drawn facing up, instead of to the right, and you want to fire them at an angle. In which case you can set the angle offset to be 90 and they'll be properly rotated when fired.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • An optional angle offset applied to the Bullets when they are launched. This is useful if for example your bullet sprites have been drawn facing up, instead of to the right, and you want to fire them at an angle. In which case you can set the angle offset to be 90 and they'll be properly rotated when fired.

    -

    Parameters

    • value: number

    Returns void

bulletAngleVariance

  • get bulletAngleVariance(): number
  • set bulletAngleVariance(value: number): void

bulletAngleVariance

  • get bulletAngleVariance(): number
  • set bulletAngleVariance(value: number): void
  • This is a variance added to the angle of Bullets when they are fired. If you fire from an angle of 90 and have a bulletAngleVariance of 20 then the actual angle of the Bullets will be between 70 and 110 degrees. This is a quick way to add a great 'spread' effect to a Weapon.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • This is a variance added to the angle of Bullets when they are fired. If you fire from an angle of 90 and have a bulletAngleVariance of 20 then the actual angle of the Bullets will be between 70 and 110 degrees. This is a quick way to add a great 'spread' effect to a Weapon.

    -

    Parameters

    • value: number

    Returns void

bulletAnimation

  • get bulletAnimation(): string
  • set bulletAnimation(value: string): void

bulletAnimation

  • get bulletAnimation(): string
  • set bulletAnimation(value: string): void

bulletBounds

bulletBounds

bulletClass

  • get bulletClass(): typeof Bullet
  • set bulletClass(classType: typeof Bullet): void

bulletClass

  • get bulletClass(): typeof Bullet
  • set bulletClass(classType: typeof Bullet): void
  • The Class of the bullets that are launched by this Weapon. Defaults to Bullet, but can be overridden before calling createBullets and set to your own class type.

    It should be a class (or constructor function) accepting the same params as Bullet, i.e. (scene: Phaser.Scene, x: number, y: number, key: string, frame: string | number).

    defaultvalue

    Bullet

    -

    Returns typeof Bullet

  • +

    Returns typeof Bullet

  • The Class of the bullets that are launched by this Weapon. Defaults to Bullet, but can be overridden before calling createBullets and set to your own class type.

    It should be a class (or constructor function) accepting the same params as Bullet, i.e. (scene: Phaser.Scene, x: number, y: number, key: string, frame: string | number).

    -

    Parameters

    Returns void

bulletCollideWorldBounds

  • get bulletCollideWorldBounds(): boolean
  • set bulletCollideWorldBounds(value: boolean): void

bulletCollideWorldBounds

  • get bulletCollideWorldBounds(): boolean
  • set bulletCollideWorldBounds(value: boolean): void
  • Should bullets collide with the World bounds or not?

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • Should bullets collide with the World bounds or not?

    -

    Parameters

    • value: boolean

    Returns void

bulletFrame

  • get bulletFrame(): string | number
  • set bulletFrame(value: string | number): void

bulletFrame

  • get bulletFrame(): string | number
  • set bulletFrame(value: string | number): void
  • The Texture Frame that the Bullets use when rendering. Changing this has no effect on bullets in-flight, only on newly spawned bullets.

    defaultvalue

    ''

    -

    Returns string | number

  • +

    Returns string | number

  • The Texture Frame that the Bullets use when rendering. Changing this has no effect on bullets in-flight, only on newly spawned bullets.

    -

    Parameters

    • value: string | number

    Returns void

bulletFrameCycle

  • get bulletFrameCycle(): boolean
  • set bulletFrameCycle(value: boolean): void

bulletFrameCycle

  • get bulletFrameCycle(): boolean
  • set bulletFrameCycle(value: boolean): void
  • If you've added a set of frames via setBulletFrames then you can optionally chose for each Bullet fired to use the next frame in the set. The frame index is then advanced one frame until it reaches the end of the set, then it starts from the start again. Cycling frames like this allows you to create varied bullet effects via sprite sheets.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • If you've added a set of frames via setBulletFrames then you can optionally chose for each Bullet fired to use the next frame in the set. The frame index is then advanced one frame until it reaches the end of the set, then it starts from the start again. Cycling frames like this allows you to create varied bullet effects via sprite sheets.

    -

    Parameters

    • value: boolean

    Returns void

bulletFrameIndex

  • get bulletFrameIndex(): number
  • set bulletFrameIndex(value: number): void

bulletFrameIndex

  • get bulletFrameIndex(): number
  • set bulletFrameIndex(value: number): void

bulletFrameRandom

  • get bulletFrameRandom(): boolean
  • set bulletFrameRandom(value: boolean): void

bulletFrameRandom

  • get bulletFrameRandom(): boolean
  • set bulletFrameRandom(value: boolean): void
  • If you've added a set of frames via setBulletFrames then you can optionally chose for each Bullet fired to pick a random frame from the set.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • If you've added a set of frames via setBulletFrames then you can optionally chose for each Bullet fired to pick a random frame from the set.

    -

    Parameters

    • value: boolean

    Returns void

bulletFrames

  • get bulletFrames(): number[]
  • set bulletFrames(value: number[]): void

bulletFrames

  • get bulletFrames(): number[]
  • set bulletFrames(value: number[]): void

bulletGravity

bulletGravity

  • This is the acceleration due to gravity added to the Bullets physics body when fired, in pixels per second squared. Total gravity is the sum of this vector and the simulation's gravity.

    -

    Returns Vector2

  • +

    Returns Vector2

  • This is the acceleration due to gravity added to the Bullets physics body when fired, in pixels per second squared. Total gravity is the sum of this vector and the simulation's gravity.

    -

    Parameters

    Returns void

bulletInheritSpriteSpeed

  • get bulletInheritSpriteSpeed(): boolean
  • set bulletInheritSpriteSpeed(value: boolean): void

bulletInheritSpriteSpeed

  • get bulletInheritSpriteSpeed(): boolean
  • set bulletInheritSpriteSpeed(value: boolean): void

bulletKey

  • get bulletKey(): string
  • set bulletKey(value: string): void

bulletKey

  • get bulletKey(): string
  • set bulletKey(value: string): void
  • The Texture Key that the Bullets use when rendering. Changing this has no effect on bullets in-flight, only on newly spawned bullets.

    defaultvalue

    ''

    -

    Returns string

  • +

    Returns string

  • The Texture Key that the Bullets use when rendering. Changing this has no effect on bullets in-flight, only on newly spawned bullets.

    -

    Parameters

    • value: string

    Returns void

bulletKillDistance

  • get bulletKillDistance(): number
  • set bulletKillDistance(value: number): void

bulletKillDistance

  • get bulletKillDistance(): number
  • set bulletKillDistance(value: number): void

bulletKillType

bulletKillType

bulletLifespan

  • get bulletLifespan(): number
  • set bulletLifespan(value: number): void

bulletLifespan

  • get bulletLifespan(): number
  • set bulletLifespan(value: number): void
  • If you've set bulletKillType to KILL_LIFESPAN this controls the amount of lifespan the Bullets have set on launch. The value is given in milliseconds. When a Bullet hits its lifespan limit it will be automatically killed.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • If you've set bulletKillType to KILL_LIFESPAN this controls the amount of lifespan the Bullets have set on launch. The value is given in milliseconds. When a Bullet hits its lifespan limit it will be automatically killed.

    -

    Parameters

    • value: number

    Returns void

bulletRotateToVelocity

  • get bulletRotateToVelocity(): boolean
  • set bulletRotateToVelocity(value: boolean): void

bulletRotateToVelocity

  • get bulletRotateToVelocity(): boolean
  • set bulletRotateToVelocity(value: boolean): void
  • Bullets can optionally adjust their rotation in-flight to match their velocity. This can create the effect of a bullet 'pointing' to the path it is following, for example an arrow being fired from a bow, and works especially well when added to bulletGravity.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • Bullets can optionally adjust their rotation in-flight to match their velocity. This can create the effect of a bullet 'pointing' to the path it is following, for example an arrow being fired from a bow, and works especially well when added to bulletGravity.

    -

    Parameters

    • value: boolean

    Returns void

bulletSpeed

  • get bulletSpeed(): number
  • set bulletSpeed(value: number): void

bulletSpeed

  • get bulletSpeed(): number
  • set bulletSpeed(value: number): void
  • The initial velocity of fired bullets, in pixels per second.

    defaultvalue

    200

    -

    Returns number

  • +

    Returns number

  • The initial velocity of fired bullets, in pixels per second.

    -

    Parameters

    • value: number

    Returns void

bulletSpeedVariance

  • get bulletSpeedVariance(): number
  • set bulletSpeedVariance(value: number): void

bulletSpeedVariance

  • get bulletSpeedVariance(): number
  • set bulletSpeedVariance(value: number): void
  • This is a variance added to the speed of Bullets when they are fired. If bullets have a bulletSpeed value of 200, and a bulletSpeedVariance of 50 then the actual speed of the Bullets will be between 150 and 250 pixels per second.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • This is a variance added to the speed of Bullets when they are fired. If bullets have a bulletSpeed value of 200, and a bulletSpeedVariance of 50 then the actual speed of the Bullets will be between 150 and 250 pixels per second.

    -

    Parameters

    • value: number

    Returns void

bulletWorldWrap

  • get bulletWorldWrap(): boolean
  • set bulletWorldWrap(value: boolean): void

bulletWorldWrap

  • get bulletWorldWrap(): boolean
  • set bulletWorldWrap(value: boolean): void
  • Should the Bullets wrap around the world bounds? This automatically calls World.wrap on the Bullet each frame. See the docs for that method for details.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • Should the Bullets wrap around the world bounds? This automatically calls World.wrap on the Bullet each frame. See the docs for that method for details.

    -

    Parameters

    • value: boolean

    Returns void

bulletWorldWrapPadding

  • get bulletWorldWrapPadding(): number
  • set bulletWorldWrapPadding(value: number): void

bulletWorldWrapPadding

  • get bulletWorldWrapPadding(): number
  • set bulletWorldWrapPadding(value: number): void
  • If bulletWorldWrap is true then you can provide an optional padding value with this property. It's added to the calculations determining when the Bullet should wrap around the world or not. The value is given in pixels.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • If bulletWorldWrap is true then you can provide an optional padding value with this property. It's added to the calculations determining when the Bullet should wrap around the world or not. The value is given in pixels.

    -

    Parameters

    • value: number

    Returns void

bullets

  • get bullets(): Group
  • set bullets(value: Group): void

bullets

  • get bullets(): Group
  • set bullets(value: Group): void

fireAngle

  • get fireAngle(): number
  • set fireAngle(value: number): void

fireAngle

  • get fireAngle(): number
  • set fireAngle(value: number): void
  • The angle at which the bullets are fired. This can be a const such as ANGLE_UP or it can be any number from 0 to 360 inclusive, where 0 degrees is to the right.

    defaultvalue

    ANGLE_UP

    -

    Returns number

  • +

    Returns number

  • The angle at which the bullets are fired. This can be a const such as ANGLE_UP or it can be any number from 0 to 360 inclusive, where 0 degrees is to the right.

    -

    Parameters

    • value: number

    Returns void

fireFrom

fireFrom

  • This is a Rectangle from within which the bullets are fired. By default it's a 1x1 rectangle, the equivalent of a Point. But you can change the width and height, and if larger than 1x1 it'll pick a random point within the rectangle to launch the bullet from.

    -

    Returns Rectangle

  • +

    Returns Rectangle

  • This is a Rectangle from within which the bullets are fired. By default it's a 1x1 rectangle, the equivalent of a Point. But you can change the width and height, and if larger than 1x1 it'll pick a random point within the rectangle to launch the bullet from.

    -

    Parameters

    Returns void

fireLimit

  • get fireLimit(): number
  • set fireLimit(value: number): void

fireLimit

  • get fireLimit(): number
  • set fireLimit(value: number): void
  • The maximum number of shots that this Weapon is allowed to fire before it stops. When the limit is hit the WEAPON_FIRE_LIMIT event is dispatched. You can reset the shot counter via resetShots.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • The maximum number of shots that this Weapon is allowed to fire before it stops. When the limit is hit the WEAPON_FIRE_LIMIT event is dispatched. You can reset the shot counter via resetShots.

    -

    Parameters

    • value: number

    Returns void

fireRate

  • get fireRate(): number
  • set fireRate(value: number): void

fireRate

  • get fireRate(): number
  • set fireRate(value: number): void
  • The minimum interval between shots, in milliseconds.

    defaultvalue

    100

    -

    Returns number

  • +

    Returns number

  • The minimum interval between shots, in milliseconds.

    -

    Parameters

    • value: number

    Returns void

fireRateVariance

  • get fireRateVariance(): number
  • set fireRateVariance(value: number): void

fireRateVariance

  • get fireRateVariance(): number
  • set fireRateVariance(value: number): void
  • This is a modifier that is added to the fireRate each update to add variety to the firing rate of the Weapon. The value is given in milliseconds. If you've a fireRate of 200 and a fireRateVariance of 50 then the actual firing rate of the Weapon will be between 150 and 250.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • This is a modifier that is added to the fireRate each update to add variety to the firing rate of the Weapon. The value is given in milliseconds. If you've a fireRate of 200 and a fireRateVariance of 50 then the actual firing rate of the Weapon will be between 150 and 250.

    -

    Parameters

    • value: number

    Returns void

multiFire

  • get multiFire(): boolean
  • set multiFire(value: boolean): void

multiFire

  • get multiFire(): boolean
  • set multiFire(value: boolean): void
  • If you want this Weapon to be able to fire more than 1 bullet in a single update, then set this property to true. When true the Weapon plugin won't set the shot / firing timers until the postRender phase of the game loop. This means you can call fire (and similar methods) as often as you like in one single game update.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • If you want this Weapon to be able to fire more than 1 bullet in a single update, then set this property to true. When true the Weapon plugin won't set the shot / firing timers until the postRender phase of the game loop. This means you can call fire (and similar methods) as often as you like in one single game update.

    -

    Parameters

    • value: boolean

    Returns void

shots

  • get shots(): number
  • set shots(value: number): void

shots

  • get shots(): number
  • set shots(value: number): void
  • The total number of bullets this Weapon has fired so far. You can limit the number of shots allowed (via fireLimit), and reset this total via resetShots.

    defaultvalue

    0

    -

    Returns number

  • +

    Returns number

  • The total number of bullets this Weapon has fired so far. You can limit the number of shots allowed (via fireLimit), and reset this total via resetShots.

    -

    Parameters

    • value: number

    Returns void

trackOffset

trackOffset

  • The Track Offset is a Vector2 object that allows you to specify a pixel offset that bullets use when launching from a tracked Sprite or Pointer. For example if you've got a bullet that is 2x2 pixels in size, but you're tracking a Sprite that is 32x32, then you can set trackOffset.x = 16 to have the bullet launched from the center of the Sprite.

    -

    Returns Vector2

  • +

    Returns Vector2

  • The Track Offset is a Vector2 object that allows you to specify a pixel offset that bullets use when launching from a tracked Sprite or Pointer. For example if you've got a bullet that is 2x2 pixels in size, but you're tracking a Sprite that is 32x32, then you can set trackOffset.x = 16 to have the bullet launched from the center of the Sprite.

    -

    Parameters

    Returns void

trackRotation

  • get trackRotation(): boolean
  • set trackRotation(value: boolean): void

trackRotation

  • get trackRotation(): boolean
  • set trackRotation(value: boolean): void
  • If the Weapon is tracking a Sprite, should it also track the Sprites rotation? This is useful for a game such as Asteroids, where you want the weapon to fire based on the sprites rotation.

    defaultvalue

    false

    -

    Returns boolean

  • +

    Returns boolean

  • If the Weapon is tracking a Sprite, should it also track the Sprites rotation? This is useful for a game such as Asteroids, where you want the weapon to fire based on the sprites rotation.

    -

    Parameters

    • value: boolean

    Returns void

trackedPointer

  • get trackedPointer(): undefined | Pointer
  • set trackedPointer(value: undefined | Pointer): void

trackedPointer

  • get trackedPointer(): undefined | Pointer
  • set trackedPointer(value: undefined | Pointer): void

trackedSprite

trackedSprite

x

  • get x(): number
  • set x(value: number): void

x

  • get x(): number
  • set x(value: number): void

y

  • get y(): number
  • set y(value: number): void

y

  • get y(): number
  • set y(value: number): void

Methods

addBulletAnimation

  • addBulletAnimation(name: string, frames?: AnimationFrame[], frameRate?: number, repeat?: number): Weapon

Methods

addBulletAnimation

  • addBulletAnimation(name: string, frames?: AnimationFrame[], frameRate?: number, repeat?: number): Weapon
  • Adds a new animation under the given key. Optionally set the frames, frame rate and loop. The arguments are all the same as for AnimationManager.add, and work in the same way.

    bulletAnimation will be set to this animation after it's created. From that point on, all @@ -412,7 +412,7 @@

    The listener function.

  • Optional context: any

    The context to invoke the listener with. Default this.

    -

Returns Weapon

createBullets

  • createBullets(quantity?: number, key?: string, frame?: string | number, group?: Group, bulletClass?: typeof Bullet): Weapon

Returns Weapon

createBullets

  • createBullets(quantity?: number, key?: string, frame?: string | number, group?: Group, bulletClass?: typeof Bullet): Weapon
  • This method performs two actions: First it will check to see if the bullets Group exists or not, and if not it creates it, adding its children to the group given as the 4th argument.

    @@ -443,7 +443,7 @@
  • Optional group: Group

    Optional Group to add the object to.

  • Optional bulletClass: typeof Bullet

Returns Weapon

This Weapon instance.

-

destroy

  • destroy(): void

destroy

  • destroy(): void
  • Destroys this Weapon. You must release everything in here, all references, all objects, free it all up.

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • @@ -454,7 +454,7 @@

    Additional arguments that will be passed to the event handler.

Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Return an array listing the events for which the emitter has registered listeners.

    -

    Returns (string | symbol)[]

fire

fire

  • Attempts to fire a single Bullet. If there are no more bullets available in the pool, and the pool cannot be extended, then this method returns undefined. It will also return undefined if not enough time has expired since the last time the Weapon was fired, @@ -468,7 +468,9 @@

    If you wish to fire multiple bullets in a single game update, then set Weapon.multiFire = true and you can call fire as many times as you like, per loop. Multiple fires in a single update only counts once towards the shots total, but you will still receive an event for each bullet.

    -

    Parameters

fireAtPointer

fireAtPointer

  • Fires a bullet at the given Pointer. The bullet will be launched from the fireFrom position, or from a Tracked Sprite or Pointer, if you have one set.

    Parameters

    • Optional pointer: Pointer

      The Pointer to fire the bullet towards.

    Returns undefined | Bullet

    The fired bullet if successful, undefined otherwise.

    -

fireAtSprite

fireAtSprite

  • Fires a bullet at the given Sprite. The bullet will be launched from the fireFrom position, or from a Tracked Sprite or Pointer, if you have one set.

    Parameters

    • Optional sprite: Sprite

      The Sprite to fire the bullet towards.

    Returns undefined | Bullet

    The fired bullet if successful, undefined otherwise.

    -

fireAtXY

  • fireAtXY(x?: number, y?: number): undefined | Bullet

fireAtXY

  • fireAtXY(x?: number, y?: number): undefined | Bullet
  • Fires a bullet at the given coordinates. The bullet will be launched from the fireFrom position, or from a Tracked Sprite or Pointer, if you have one set.

    Parameters

    • Optional x: number
      @@ -504,7 +506,7 @@
    • Optional y: number

      The y coordinate, in world space, to fire the bullet towards.

    Returns undefined | Bullet

    The fired bullet if successful, undefined otherwise.

    -

fireMany

fireMany

  • Attempts to fire multiple bullets from the positions defined in the given array.

    If you provide a from argument, or if there is a tracked Sprite or Pointer, then the positions are treated as offsets from the given objects position.

    @@ -523,7 +525,7 @@ instead of any trackedSprite or trackedPointer that is set.

Returns Bullet[]

An array containing all of the fired Bullet objects, if a launch was successful, otherwise an empty array.

-

fireOffset

  • fireOffset(offsetX?: number, offsetY?: number): undefined | Bullet

fireOffset

  • fireOffset(offsetX?: number, offsetY?: number): undefined | Bullet
  • Attempts to fire a single Bullet from a tracked Sprite or Pointer, but applies an offset to the position first. This is the same as calling fire and passing in the offset arguments.

    If there are no more bullets available in the pool, and the pool cannot be extended, @@ -541,7 +543,7 @@

    The vertical offset from the position of the tracked Sprite or Pointer, as set with trackSprite.

Returns undefined | Bullet

The fired bullet, if a launch was successful, otherwise undefined.

-

forEach

  • forEach(callback: (child: GameObject, ...args: unknown[]) => void, callbackContext: unknown, ...args: unknown[]): Weapon

forEach

  • forEach(callback: (child: GameObject, ...args: unknown[]) => void, callbackContext: unknown, ...args: unknown[]): Weapon
  • Call a function on each in-flight bullet in this Weapon.

    See Set.each for more details.

    Parameters

    • callback: (child: GameObject, ...args: unknown[]) => void
      @@ -552,7 +554,7 @@
    • Rest ...args: unknown[]

      Additional arguments to pass to the callback function, after the child item.

    Returns Weapon

    This Weapon instance.

    -

killAll

killAll

  • Calls Bullet.kill on every in-flight bullet in this Weapon. Also re-enables their physics bodies, should they have been disabled via pauseAll.

    Returns Weapon

    This Weapon instance.

    @@ -590,12 +592,12 @@

    The listener function.

  • Optional context: any

    The context to invoke the listener with. Default this.

    -

Returns Weapon

pauseAll

Returns Weapon

pauseAll

  • Sets Body.enable to false on each bullet in this Weapon. This has the effect of stopping them in-flight should they be moving. It also stops them being able to be checked for collision.

    Returns Weapon

    This Weapon instance.

    -

postRender

  • postRender(): void

postRender

  • postRender(): void
  • Internal postRender method, called by the Weapon Plugin. Used for instance when multiFire is enabled.

    internal

    Returns void

removeAllListeners

  • removeAllListeners(event?: string | symbol): Weapon
  • @@ -612,18 +614,18 @@

    Only remove the listeners that have this context.

  • Optional once: boolean

    Only remove one-time listeners.

    -

Returns Weapon

resetShots

  • resetShots(newLimit?: number): Weapon

Returns Weapon

resetShots

  • resetShots(newLimit?: number): Weapon
  • Resets the shots counter back to zero. This is used when you've set fireLimit and have hit (or just wish to reset) your limit.

    Parameters

    • Optional newLimit: number

      Optionally set a new fireLimit.

    Returns Weapon

    This Weapon instance.

    -

resumeAll

resumeAll

  • Sets Body.enable to true on each bullet in this Weapon. This has the effect of resuming their motion should they be in-flight. It also enables them for collision checks again.

    Returns Weapon

    This Weapon instance.

    -

setBulletBodyOffset

  • setBulletBodyOffset(width: number, height: number, offsetX?: number, offsetY?: number): Weapon

setBulletBodyOffset

  • setBulletBodyOffset(width: number, height: number, offsetX?: number, offsetY?: number): Weapon
  • You can modify the size of the physics Body the Bullets use to be any dimension you need. This allows you to make it smaller, or larger, than the parent Sprite. You can also control the x and y offset of the Body. This is the position of the @@ -643,7 +645,7 @@

  • offsetY: number = 0

    The Y offset of the Body from the top-left of the Sprites texture.

Returns Weapon

This Weapon instance.

-

setBulletFrames

  • setBulletFrames(min: number, max: number, selectionMethod?: FrameType): Weapon

setBulletFrames

  • setBulletFrames(min: number, max: number, selectionMethod?: FrameType): Weapon
  • Sets the texture frames that the bullets can use when being launched.

    This is intended for use when you've got numeric based frames, such as those loaded via a Sprite Sheet.

    @@ -662,7 +664,7 @@

Returns Weapon

This Weapon instance.

shutdown

  • shutdown(): void
  • Removes all listeners.

    -

    Returns void

trackPointer

  • trackPointer(pointer?: Pointer, offsetX?: number, offsetY?: number): Weapon

trackPointer

  • trackPointer(pointer?: Pointer, offsetX?: number, offsetY?: number): Weapon
  • Sets this Weapon to track the given Pointer. When a Weapon tracks a Pointer it will automatically update its fireFrom value to match the Pointer's position within the Game World, adjusting the coordinates based on the offset arguments.

    @@ -677,7 +679,7 @@
  • offsetY: number = 0

    The vertical offset from the Pointers position to be applied to the Weapon.

Returns Weapon

This Weapon instance.

-

trackSprite

trackSprite

  • Sets this Weapon to track the given Sprite, or any Object with x/y coords and optionally rotation When a Weapon tracks a Sprite it will automatically update its fireFrom value to match the Sprite's position within the Game World, adjusting the coordinates based on the offset arguments.

    @@ -693,7 +695,7 @@
  • trackRotation: boolean = false

    Should the Weapon also track the Sprites rotation?

Returns Weapon

This Weapon instance.

-

update

  • update(): void

update

  • update(): void
  • Internal update method, called by the Weapon Plugin. Used for updating weapon bounds and handling autofire.

    internal

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Protected method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/WeaponPlugin.html b/docs/classes/WeaponPlugin.html index 78a22b2..85e431b 100644 --- a/docs/classes/WeaponPlugin.html +++ b/docs/classes/WeaponPlugin.html @@ -6,7 +6,7 @@ Phaser.Scene.create method:

// Install it into a scene
this.plugins.installScenePlugin(
'WeaponPlugin',
WeaponPlugin,
'weapons',
this
);
-

Hierarchy

Index

Constructors

constructor

Hierarchy

Index

Constructors

constructor

  • Parameters

    • scene: Scene

      A reference to the Phaser.Scene instance.

    • pluginManager: PluginManager

      A reference to the @@ -32,7 +32,7 @@ Only set if it's a Scene Plugin, otherwise null. This property is only set when the plugin is instantiated and added to the Scene, not before. You can use it during the boot method.

      -

weapons

weapons: Weapon[]

Methods

add

  • add(bulletLimit?: number, key?: string, frame?: string, group?: Group, weaponClass?: typeof Weapon): Weapon

weapons

weapons: Weapon[]

Methods

add

  • add(bulletLimit?: number, key?: string, frame?: string, group?: Group, weaponClass?: typeof Weapon): Weapon
  • Parameters

    • Optional bulletLimit: number

      The quantity of bullets to seed the Weapon with. If -1 it will set the pool to automatically expand.

    • Optional key: string

      The Game.cache key of the image that this Sprite will use.

      @@ -43,11 +43,11 @@
    • weaponClass: typeof Weapon = ...

      Optional custom class for the Weapon.

    Returns Weapon

    The weapon that was created

    -

boot

  • boot(): void

boot

  • boot(): void
  • If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. By this point the plugin properties scene and systems will have already been set. In here you can listen for Scene events and set-up whatever you need for this plugin to run.

    -

    Returns void

destroy

  • destroy(): void

destroy

  • destroy(): void
  • Destroys this Weapon. You must release everything in here, all references, all objects, free it all up.

    Returns void

init

  • init(data?: any): void
  • @@ -58,9 +58,9 @@ On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead.

    Parameters

    • Optional data: any

      A value specified by the user, if any, from the data property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's install method (if started manually).

      -

    Returns void

Protected postRender

  • postRender(): void

Returns void

Protected postRender

  • postRender(): void

start

  • start(): void

start

  • start(): void
  • Called by the PluginManager when this plugin is started. If a plugin is stopped, and then started again, this will get called again. Typically called immediately after BasePlugin.init.

    @@ -71,6 +71,6 @@ Handle that process here (i.e. stop listening for events, etc) If the plugin is started again then BasePlugin.start will be called again. On a Scene Plugin, this method is never called.

    -

    Returns void

Protected update

  • update(): void

Protected update

  • update(): void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Protected method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/consts.Angle.html b/docs/enums/consts.Angle.html index fa22961..06161f5 100644 --- a/docs/enums/consts.Angle.html +++ b/docs/enums/consts.Angle.html @@ -1,19 +1,19 @@ Angle | phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

Angle constants that can be used anywhere you specify angles in degrees, for instance Weapon.fireAngle and Weapon.bulletAngleOffset.

-

Index

Enumeration members

ANGLE_DOWN

ANGLE_DOWN = 90
+

Index

Enumeration members

ANGLE_DOWN

ANGLE_DOWN = 90

The Angle (in degrees) a Game Object needs to be set to in order to face down.

-

ANGLE_LEFT

ANGLE_LEFT = 180
+

ANGLE_LEFT

ANGLE_LEFT = 180

The Angle (in degrees) a Game Object needs to be set to in order to face left.

-

ANGLE_NORTH_EAST

ANGLE_NORTH_EAST = 315
+

ANGLE_NORTH_EAST

ANGLE_NORTH_EAST = 315

The Angle (in degrees) a Game Object needs to be set to in order to face north east.

-

ANGLE_NORTH_WEST

ANGLE_NORTH_WEST = 225
+

ANGLE_NORTH_WEST

ANGLE_NORTH_WEST = 225

The Angle (in degrees) a Game Object needs to be set to in order to face north west.

-

ANGLE_RIGHT

ANGLE_RIGHT = 0
+

ANGLE_RIGHT

ANGLE_RIGHT = 0

The Angle (in degrees) a Game Object needs to be set to in order to face right.

-

ANGLE_SOUTH_EAST

ANGLE_SOUTH_EAST = 45
+

ANGLE_SOUTH_EAST

ANGLE_SOUTH_EAST = 45

The Angle (in degrees) a Game Object needs to be set to in order to face south east.

-

ANGLE_SOUTH_WEST

ANGLE_SOUTH_WEST = 135
+

ANGLE_SOUTH_WEST

ANGLE_SOUTH_WEST = 135

The Angle (in degrees) a Game Object needs to be set to in order to face south west.

-

ANGLE_UP

ANGLE_UP = 270
+

ANGLE_UP

ANGLE_UP = 270

The Angle (in degrees) a Game Object needs to be set to in order to face up.

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Protected method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/consts.FrameType.html b/docs/enums/consts.FrameType.html index daa70f1..12a7593 100644 --- a/docs/enums/consts.FrameType.html +++ b/docs/enums/consts.FrameType.html @@ -1,10 +1,10 @@ FrameType | phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

Bullet frame type constants for Weapon.setBulletFrames

-

Index

Enumeration members

BULLET_FRAME_CYCLE

BULLET_FRAME_CYCLE = 1
+

Index

Enumeration members

BULLET_FRAME_CYCLE

BULLET_FRAME_CYCLE = 1

When selecting a bullet frame the next frame should be used

-

BULLET_FRAME_RANDOM

BULLET_FRAME_RANDOM = 2
+

BULLET_FRAME_RANDOM

BULLET_FRAME_RANDOM = 2

When selecting a bullet frame a random frame should be used.

-

BULLET_FRAME_STABLE

BULLET_FRAME_STABLE = 0
+

BULLET_FRAME_STABLE

BULLET_FRAME_STABLE = 0

When selecting a bullet frame the same frame should always be used. This is the default value.

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Protected method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/consts.KillType.html b/docs/enums/consts.KillType.html index f2b8e5e..c1d71fe 100644 --- a/docs/enums/consts.KillType.html +++ b/docs/enums/consts.KillType.html @@ -1,25 +1,25 @@ KillType | phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

Kill type constants for Weapon.bulletKillType

-

Index

Enumeration members

KILL_CAMERA_BOUNDS

KILL_CAMERA_BOUNDS = 4
+

Index

Enumeration members

KILL_CAMERA_BOUNDS

KILL_CAMERA_BOUNDS = 4

A bulletKillType constant that automatically kills the bullets when they leave the Camera.getBounds rectangle.

-

KILL_DISTANCE

KILL_DISTANCE = 2
+

KILL_DISTANCE

KILL_DISTANCE = 2

A bulletKillType constant that automatically kills the bullets after they exceed the Weapon.bulletKillDistance from their original firing position.

-

KILL_LIFESPAN

KILL_LIFESPAN = 1
+

KILL_LIFESPAN

KILL_LIFESPAN = 1

A bulletKillType constant that automatically kills the bullets when their Weapon.bulletLifespan expires.

-

KILL_NEVER

KILL_NEVER = 0
+

KILL_NEVER

KILL_NEVER = 0

A bulletKillType constant that stops the bullets from ever being destroyed automatically.

-

KILL_STATIC_BOUNDS

KILL_STATIC_BOUNDS = 6
+

KILL_STATIC_BOUNDS

KILL_STATIC_BOUNDS = 6

A Weapon.bulletKillType constant that automatically kills the bullets when they leave the Weapon.bounds rectangle. The difference between static bounds and weapon bounds, is that a static bounds will never be adjusted to match the position of a tracked sprite or pointer.

-

KILL_WEAPON_BOUNDS

KILL_WEAPON_BOUNDS = 3
+

KILL_WEAPON_BOUNDS

KILL_WEAPON_BOUNDS = 3

A bulletKillType constant that automatically kills the bullets when they leave the Weapon.bounds rectangle.

-

KILL_WORLD_BOUNDS

KILL_WORLD_BOUNDS = 5
+

KILL_WORLD_BOUNDS

KILL_WORLD_BOUNDS = 5

A bulletKillType constant that automatically kills the bullets when they leave the World.bounds rectangle.

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Protected method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index a14e60e..53715cd 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,6 +1,6 @@ -phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

phaser3-weapon-plugin - v2.1.0

Index

Type aliases

ObjectWithTransform

ObjectWithTransform: ObjectWithXY & { angle?: number; body?: Phaser.Physics.Arcade.Body; rotation?: number }
+phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

phaser3-weapon-plugin - v2.1.0

Index

Type aliases

ObjectWithTransform

ObjectWithTransform: ObjectWithXY & { angle?: number; body?: Phaser.Physics.Arcade.Body; rotation?: number }

An object that has x/y coords and optional rotation. Any Sprite-like object.

-

ObjectWithXY

ObjectWithXY: { x: number; y: number }
+

ObjectWithXY

ObjectWithXY: { x: number; y: number }

Any Object, as long as it has public x and y properties, such as Point, { x: 0, y: 0 }, Sprite, etc

Type declaration

  • x: number
  • y: number

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Protected method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/events.html b/docs/modules/events.html index fdf2189..4ee3854 100644 --- a/docs/modules/events.html +++ b/docs/modules/events.html @@ -1,13 +1,13 @@ -events | phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Events

BULLET_KILL

BULLET_KILL: "kill" = 'kill'
+events | phaser3-weapon-plugin - v2.1.0
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Events

BULLET_KILL

BULLET_KILL: "kill" = 'kill'

This event is dispatched when a bullet is killed.

param bullet

The bullet that was killed

param weapon

The weapon emitting the event

-

WEAPON_FIRE

WEAPON_FIRE: "fire" = 'fire'
+

WEAPON_FIRE

WEAPON_FIRE: "fire" = 'fire'

This event is dispatched when a weapon is fired.

param bullet

The bullet that was fired

param weapon

The weapon emitting the event

param speed

The speed of the bullet

-

WEAPON_FIRE_LIMIT

WEAPON_FIRE_LIMIT: "firelimit" = 'firelimit'
+

WEAPON_FIRE_LIMIT

WEAPON_FIRE_LIMIT: "firelimit" = 'firelimit'

This event is dispatched when the weapon's fire limit is reached.

param weapon

The weapon emitting the event

param fireLimit

The fire limit