Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed return value of Plugin.Weapon's fire, fireAtXY, fireAtPointer… #2696

Merged
merged 1 commit into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/plugins/weapon/WeaponPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ Phaser.Weapon.prototype.trackPointer = function (pointer, offsetX, offsetY) {
* @param {Phaser.Sprite|Phaser.Point|Object} [from] - Optionally fires the bullet **from** the `x` and `y` properties of this object. If set this overrides `Weapon.trackedSprite` or `trackedPointer`. Pass `null` to ignore it.
* @param {number} [x] - The x coordinate, in world space, to fire the bullet **towards**. If left as `undefined` the bullet direction is based on its angle.
* @param {number} [y] - The y coordinate, in world space, to fire the bullet **towards**. If left as `undefined` the bullet direction is based on its angle.
* @return {boolean} True if a bullet was successfully fired, otherwise false.
* @return {Phaser.Bullet} The fired bullet if successful, null otherwise.
*/
Phaser.Weapon.prototype.fire = function (from, x, y) {

Expand Down Expand Up @@ -880,7 +880,7 @@ Phaser.Weapon.prototype.fire = function (from, x, y) {
this.onFireLimit.dispatch(this, this.fireLimit);
}
}

return bullet;
};

/**
Expand All @@ -889,7 +889,7 @@ Phaser.Weapon.prototype.fire = function (from, x, y) {
*
* @method Phaser.Weapon#fireAtPointer
* @param {Phaser.Pointer} [pointer] - The Pointer to fire the bullet towards.
* @return {boolean} True if a bullet was successfully fired, otherwise false.
* @return {Phaser.Bullet} The fired bullet if successful, null otherwise.
*/
Phaser.Weapon.prototype.fireAtPointer = function (pointer) {

Expand All @@ -905,7 +905,7 @@ Phaser.Weapon.prototype.fireAtPointer = function (pointer) {
*
* @method Phaser.Weapon#fireAtSprite
* @param {Phaser.Sprite} [sprite] - The Sprite to fire the bullet towards.
* @return {boolean} True if a bullet was successfully fired, otherwise false.
* @return {Phaser.Bullet} The fired bullet if successful, null otherwise.
*/
Phaser.Weapon.prototype.fireAtSprite = function (sprite) {

Expand All @@ -920,7 +920,7 @@ Phaser.Weapon.prototype.fireAtSprite = function (sprite) {
* @method Phaser.Weapon#fireAtXY
* @param {number} [x] - The x coordinate, in world space, to fire the bullet towards.
* @param {number} [y] - The y coordinate, in world space, to fire the bullet towards.
* @return {boolean} True if a bullet was successfully fired, otherwise false.
* @return {Phaser.Bullet} The fired bullet if successful, null otherwise.
*/
Phaser.Weapon.prototype.fireAtXY = function (x, y) {

Expand Down
10 changes: 5 additions & 5 deletions typescript/phaser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ declare module Phaser {
l: number;
color: number;
color32: number;
rgba: string;
rgba: string;
}

class Create {
Expand Down Expand Up @@ -5651,10 +5651,10 @@ declare module Phaser {
createBullets(quantity?: number, key?: any, frame?: any, group?: Phaser.Group): Phaser.Weapon;
debug(x?: number, y?: number, debugBodies?: boolean): void;
destroy(): void;
fire(from?: any, x?: number, y?: number): boolean;
fireAtPointer(pointer: Phaser.Pointer): boolean;
fireAtSprite(sprite: Phaser.Sprite): boolean;
fireAtXY(x: number, y: number): boolean;
fire(from?: any, x?: number, y?: number): Phaser.Bullet;
fireAtPointer(pointer: Phaser.Pointer): Phaser.Bullet;
fireAtSprite(sprite: Phaser.Sprite): Phaser.Bullet;
fireAtXY(x: number, y: number): Phaser.Bullet;
forEach(callback: any, callbackContext: any): Phaser.Weapon;
killAll(): Phaser.Weapon;
pauseAll(): Phaser.Weapon;
Expand Down