Commit graph

29 commits

Author SHA1 Message Date
Richard Davey
c625b8735b Updated to using Event Emitter for all key managers and game objects. Events are now dispatched directly using arguments instead of Event objects, all managers updated to emit directly. 2018-01-12 17:09:21 +00:00
Richard Davey
d8f1ba03e9 Moved repository location 2018-01-09 21:43:56 +00:00
Richard Davey
0d90f75b5f Splitting the dev branch up into versions. 2016-11-22 01:36:56 +00:00
Richard Davey
0af16817a5 Refactored GameObjects to GameObject. 2016-10-09 22:27:58 +01:00
Richard Davey
729020477a New Game Objects structure in place, and starting to take shape.
Moved BitmapData and RenderTexture into the textures folder for now.

All Game Objects now have their own sub-folder, with their Factory and renderer functions alongside them, plus any other files they need.

New Factory class added. Currently hooked into `game.factory` for testing, but will swap to `game.add` when complete.
2016-10-08 03:05:42 +01:00
Richard Davey
c42c447bfb Weapon.multiFire is a new property that allows you to set a Weapon as being allowed to call fire as many times as you like, per game loop. This allows a single Weapon instance to fire multiple bullets.
Weapon.fire has two new arguments: `offsetX` and `offsetY`. If the bullet is fired from a tracked Sprite or Pointer, or the `from` argument is set, this applies a horizontal and vertical offset from the launch position.

Weapon.fireOffset attempts to fire a single Bullet from a tracked Sprite or Pointer, but applies an offset to the position first. This is a shorter form of calling `Weapon.fire` and passing in the offset arguments.

Weapon.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. If `from` is undefined, and there is no tracked object, then the bullets are fired from the given positions, as they exist in the world.
2016-09-08 01:42:19 +01:00
Richard Davey
1193bc7d47 Return null instead of false. 2016-09-07 23:25:37 +01:00
James
99f0fb63bd prevent crash if weapon's bullets have not yet been initialized before settting _bulletClass 2016-08-30 17:05:27 -05:00
James
639b9161f7 updated docs on weapon's setBulletBodyOffset 2016-08-30 17:03:10 -05:00
James
3c605285ee updated weapon's fire() docs 2016-08-30 16:58:27 -05:00
Richard Davey
dd39f9ab08 Updated TS defs. 2016-08-26 01:24:15 +01:00
photonstorm
19dbd8bba8 The Weapon.fireRateVariance property was never taken into account internally. It's now applied to the firing rate correctly (thanks @noseglid #2715) 2016-08-25 13:31:43 +01:00
photonstorm
cbbb2cd97b Created _rotatedPoint in the constructor, and tidied up code formatting to match the rest of Phaser #2672 2016-08-25 13:12:42 +01:00
Richard Davey
dfbdd59f33 Merge pull request #2672 from bobonthenet/master
Weapon.Fire now tracks offset rotation
2016-08-25 13:06:31 +01:00
bobonthenet
7da5604500 Use this.rotatedPoint instead of a new object 2016-08-22 21:36:49 -04:00
James
e90619b40e changed return value of Plugin.Weapon's fire, fireAtXY, fireAtPointer, fireAtSprite to Phaser.Bullet 2016-08-17 18:24:24 -05:00
bobonthenet
6df44bd21a Apparently I didn't fix them the first time 2016-07-29 19:38:37 -04:00
bobonthenet
6d7b84b10e Fixed jshint errors 2016-07-29 19:24:49 -04:00
Robert Bedard
383f14cb3f Weapon.Fire now tracks offset rotation 2016-07-29 15:08:29 -04:00
Richard Davey
418c87ea1a Weapon.autofire wouldn't fire after the first bullet, or until fire was called, neither of which are requirements. If you now set this boolean the Weapon will fire continuously until you toggle it back to false (thanks @alverLopez #2647) 2016-07-20 11:52:48 +01:00
Richard Davey
a01f59d82d Added Path Manager Plugin. 2016-07-13 03:08:03 +01:00
David Hayes
8f36b96c8a Reorder Weapon.onFire argument order in documentation. 2016-06-19 20:39:51 -05:00
photonstorm
1a67079ae7 Phew. Added TypeScript defs for the Weapon Plugin. Don't say I never do anything for you! 2016-06-03 17:11:08 +01:00
photonstorm
61f064dfe9 Docs update. 2016-06-03 16:45:47 +01:00
photonstorm
a2d0aac9fd Docs finished. 2016-06-03 16:38:40 +01:00
photonstorm
c73ccfbddb Lots more docs updates. 2016-06-03 15:51:06 +01:00
photonstorm
d2269c362d Docs update. 2016-06-03 15:20:11 +01:00
photonstorm
96711f4db9 Added the Weapon Plugin and worked lots on its docs. 2016-06-03 15:09:43 +01:00
photonstorm
ae5be7ac92 Merging in the new Weapon Plugin. 2016-06-03 13:00:45 +01:00