Weapon#fireAtXY()

fireAtXY(x, y) → {Phaser.Bullet} Fires a bullet at the given coordinates. The bullet will be launched from the Weapon.fireFrom position,or from a Tracked Sprite or Pointer, if you have one set. Parameters Name Type Argument Description x number <optional> The x coordinate, in world space, to fire the bullet towards. y number <optional> The y coordinate, in world space, to fire the bullet towards. Returns Phaser.Bullet - The fired bullet if successful, null otherwise.

Weapon#fireAtSprite()

fireAtSprite(sprite) → {Phaser.Bullet} Fires a bullet at the given Sprite. The bullet will be launched from the Weapon.fireFrom position,or from a Tracked Sprite or Pointer, if you have one set. Parameters Name Type Argument Description sprite Phaser.Sprite <optional> The Sprite to fire the bullet towards. Returns Phaser.Bullet - The fired bullet if successful, null otherwise. Source code: plugins/weapon/WeaponPlugin.js (Line 944)

Weapon#fireAtPointer()

fireAtPointer(pointer) → {Phaser.Bullet} Fires a bullet at the given Pointer. The bullet will be launched from the Weapon.fireFrom position,or from a Tracked Sprite or Pointer, if you have one set. Parameters Name Type Argument Description pointer Phaser.Pointer <optional> The Pointer to fire the bullet towards. Returns Phaser.Bullet - The fired bullet if successful, null otherwise. Source code: plugins/weapon/WeaponPlugin.js (Line 928)

Weapon#fireAngle

fireAngle : integer The angle at which the bullets are fired. This can be a const such as Phaser.ANGLE_UPor it can be any number from 0 to 360 inclusive, where 0 degrees is to the right. Source code: plugins/weapon/WeaponPlugin.js (Line 99)

Weapon#fire()

fire(from, x, y) → {Phaser.Bullet} 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 false. It will also return false if not enough time has expired since the last timethe Weapon was fired, as defined in the Weapon.fireRate property. Otherwise the first available bullet is selected and launched. The arguments are all optional, but allow you to control both where the bullet is launched from, and aimed

Weapon#destroy()

destroy() Destroys this Weapon. It removes itself from the PluginManager, destroysthe bullets Group, and nulls internal references. Source code: plugins/weapon/WeaponPlugin.js (Line 579)

Weapon#debug()

debug(x, y, debugBodies) Uses Game.Debug to draw some useful information about this Weapon, including the number of bulletsboth in-flight, and available. And optionally the physics debug bodies of the bullets. Parameters Name Type Argument Default Description x integer <optional> 16 The coordinate, in screen space, at which to draw the Weapon debug data. y integer <optional> 32 The coordinate, in screen space, at which to draw the Weapon debug data. debugBodies boolean

Weapon#createBullets()

createBullets(quantity, key, frame, group) → {Phaser.Weapon} This method performs two actions: First it will check to see if the Weapon.bullets Group exists or not,and if not it creates it, adding it the group given as the 4th argument. Then it will seed the bullet pool with the quantity number of Bullets, using the texture key and frameprovided (if any). If for example you set the quantity to be 10, then this Weapon will only ever be able to have 10 bulletsin-flight simultaneously. If you tr

Weapon#bulletWorldWrapPadding

bulletWorldWrapPadding : integer If bulletWorldWrap is true then you can provide an optional padding value with thisproperty. It's added to the calculations determining when the Bullet should wrap aroundthe world or not. The value is given in pixels. Source code: plugins/weapon/WeaponPlugin.js (Line 144)

Weapon#bulletWorldWrap

bulletWorldWrap : boolean Should the Bullets wrap around the world bounds? This automatically callsWorld.wrap on the Bullet each frame. See the docs for that method for details. Source code: plugins/weapon/WeaponPlugin.js (Line 136)