Commit graph

458 commits

Author SHA1 Message Date
photonstorm
1c9e23f535 Emitter.start has a new parameter: forceQuantity which will force the quantity of a flow of particles to be the given value (request #853)
Emitter.explode is a new short-cut for exploding a fixed quantity of particles at once.
Emitter.flow is a new short-cut for creating a flow of particles based on the given frequency.
2014-06-02 01:15:58 +01:00
photonstorm
12252944fa Time.add allows you to add an existing Phaser.Timer to the timer pool (request #864) 2014-06-02 00:54:42 +01:00
clark-stevenson
04d9e2e815 Update phaser.d.ts
Fixes #858
2014-05-29 17:50:10 +01:00
photonstorm
3c61e1d24f Build files with Asset Pack support added. 2014-05-29 17:37:28 +01:00
photonstorm
5b5bdc80d9 Loader.pack will allow you to load in a new Phaser Asset Pack JSON file. An Asset Pack is a specially structured file that allows you to define all assets for your game in an external file. The file can be split into sections, allowing you to control loading a specific set of files from it. An example JSON file can be found in the resources folder and examples of use in the Phaser Examples repository.
Loader.totalQueuedPacks returns the number of Asset Packs in the queue.
Loader.totalLoadedPacks returns the number of Asset Packs already loaded.
2014-05-29 17:05:13 +01:00
clark-stevenson
cb3dedd485 Update phaser.d.ts
Updated from last week

Also I think #843 is solved and supports this for example. I do not really see a problem with Casting as I do it fairly frequently. 

`var filter: Phaser.Filter.Marble = new Phaser.Filter.Marble(this.game, 800, 600, 4, 1);`
`var filter: Phaser.Filter.Marble = <Phaser.Filter.Marble>this.game.add.filter("Marble", 800, 600, 4, 1);`
`var filter: Phaser.Filter = this.game.add.filter("Marble", 800, 600, 4, 1);` <-- looses intellisense
2014-05-27 23:47:29 +01:00
clark-stevenson
4a377767f9 Update phaser.d.ts
Handful of changes from Last week of Dev and fixed optional loader script callbacks/context.
2014-05-25 12:15:43 +01:00
photonstorm
bcddfc83c0 Sprite.alive property now explicitly defined on the Sprite prototype (thanks @lewster32, #841) 2014-05-21 21:48:29 +01:00
photonstorm
b8a2b9347f 2.0.5 dist files. 2014-05-20 10:03:01 +01:00
photonstorm
a8256f4ef7 defs typo fix 2014-05-20 00:08:39 +01:00
clark-stevenson
4e2e6f9128 Update phaser.d.ts 2014-05-19 22:33:36 +01:00
photonstorm
7b876d5fc4 ScaleManager.bounds is a Rectangle object that holds the exact size of the game canvas, taking DOM offset and game scale into account.
Pointer.withinGame is now accurate based on game scale and updated as the Pointer moves.
Stage.bounds is now updated if the game canvas offset changes position. Note that it gives the un-scaled game dimensions.
2014-05-19 18:49:59 +01:00
Will Huxtable
6291f6de2c getText returns a string, not an Object. 2014-05-19 18:01:37 +01:00
photonstorm
1a7305b0ad New movement data added for a Pointer Locked mouse (Pointer.movementX/Y) (thanks @woutercommandeur, #831) 2014-05-19 11:51:25 +01:00
photonstorm
da75a22e82 Cache.checkKey added - allows you to pass in a Cache type and a key and return a boolean.
Cache.checkCanvasKey(key) - Check if a Canvas key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTextureKey(key) - Check if a Texture key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkSoundKey(key) - Check if a Sound key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTextKey(key) - Check if a Text key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkPhysicsKey(key) - Check if a Physics key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTilemapKey(key) - Check if a Tilemap key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBinaryKey(key) - Check if a Binary key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBitmapDataKey(key) - Check if a BitmapData key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBitmapFontKey(key) - Check if a BitmapFont key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkJSONKey(key) - Check if a JSON key exists in the cache (thanks to @delta11 for the proposal)
2014-05-19 11:34:14 +01:00
clark-stevenson
566b870785 Update phaser.d.ts
Updates from past week
2014-05-14 15:54:40 +01:00
clark-stevenson
30b2b40810 Update IPixiRenderer Interface
Thanks @natelong

Solves
http://www.html5gamedevs.com/topic/1638-changing-game-size-to-fit-page/?p=36922
2014-05-08 13:36:51 +01:00
Maxime Fabre
8d88e08115 Fix type of Tilemap.foreach callback 2014-05-08 01:57:19 +02:00
clark-stevenson
266417e735 Update phaser.d.ts
Past week of updates on dev. 
Note also includes #799
2014-05-04 16:36:58 +01:00
Richard Davey
afc4f1793d Merge pull request #787 from luispedrofonseca/master
Updated TypeScript definitions
2014-05-01 12:30:13 +01:00
Luis Fonseca
d49a8f1159 Update TypeScript definitions
Made the "index" parameter optional to reflect the JS version.
2014-04-30 15:00:53 +01:00
photonstorm
4af89dbd15 2.0.5-dev build release. 2014-04-29 23:00:28 +01:00
photonstorm
e0083dcb26 Phaser 2.0.4 zero hour update. 2014-04-29 22:40:18 +01:00
photonstorm
26b2aa42ab Patching back into 2.0.4 master release a couple of important updates.
Tilemap.getTile and getTileXY used to return `null` in 2.0.3 but returned a Tile object in 2.0.4 (with an index of -1), they now return `null` again.
ScaleManager seeds _check private var with null to avoid later comparison check (thanks @jflowers45, fix #782)
P2.Body.applyForce should have used pxmi instead of pxm (thanks @Trufi, fix #776)
P2 fixed creation of RevoluteConstraint by passing maxForce in the options (thanks @woutercommandeur, fix #783)
Merge pull request #783 from woutercommandeur/dev

fix creation of RevoluteConstraint by passing maxForce in the options
2014-04-29 22:35:30 +01:00
photonstorm
486153d3e0 Patching back into 2.0.4 master release a couple of important updates. 2014-04-29 22:00:16 +01:00
photonstorm
1c92caad42 2.0.4 release build 2014-04-29 15:39:53 +01:00
Franky Lau
4a31db6a64 Update phaser.d.ts
Fix imcompatible override Phaser.Point.clone
2014-04-28 22:12:25 +08:00
clark-stevenson
53da55d6a8 Fixed Emitter.makeParticles optional parameters 2014-04-28 14:23:44 +01:00
photonstorm
bcd64fd44b More Timer tests. 2014-04-26 16:16:18 +01:00
clark-stevenson
8b01abfbec BitmapData + Color updates mostly. 2014-04-26 01:34:19 +01:00
photonstorm
54b71ddc23 Phaser.ArrayList is a new iterative object, similar in principal to a linked list but operating on a single array without modifying the object structure.
Input and Pointer now use the new ArrayList instead of a LinkedList, which resolve list item removable during callback issues.
Input.reset no longer resets every interactive item it knows of, because they are removed during the destroy phase and can now persist between States if needed.
2014-04-25 15:11:54 +01:00
photonstorm
0f1e0a3d4e Updated the Device little / big endianess check. 2014-04-23 23:35:36 +01:00
photonstorm
b6cc150a15 Game.scratch is a single handy BitmapData instance that can be used as a visual scratch-pad, for off-screen bitmap manipulation (and is used as such by BitmapData itself).
Updated TS defs.
2014-04-23 22:14:47 +01:00
clark-stevenson
4e2afcc270 Update phaser.d.ts
Fixed typo. I must have been having fun without knowing it.
2014-04-23 10:47:00 +01:00
clark-stevenson
b00e60a996 Update phaser.d.ts
Couple of updates for last week of dev.
2014-04-23 08:26:26 +01:00
photonstorm
4ec5665148 Fixed #750 - Invalid typescript mapping for TileSprite.autoScroll function in TS defs.
Game checks if window.console exists before using it (should fix IE9 issues when dev tools are closed), however it is still used deeper in Pixi.
Body.loadData flagged as deprecated.
2014-04-22 23:31:07 +01:00
photonstorm
e4887c8177 If Tween.yoyo was true but repeat was 0 then it wouldn't yoyo. Now if yoyo is set, but not repeat, the repeat count gets set to 1 (thanks @hilts-vaughan, fix #744) 2014-04-22 02:12:21 +01:00
Dmytrii Shchadei
d8e158ba87 fix wrong definition for Phaser.Point.rotate 2014-04-20 22:42:37 +02:00
qdrj
c8f1a15be2 Fix phaser.d.ts
Add missing semicolons from d.ts file. Now it's working with WebStorm 8.
2014-04-19 12:11:26 +04:00
qdrj
52a2c2612b Revert "Add missing semicolons. Now working with WebStorm 8."
This reverts commit 01b7a5957a.
2014-04-19 12:05:43 +04:00
qdrj
01b7a5957a Add missing semicolons. Now working with WebStorm 8. 2014-04-19 11:53:42 +04:00
photonstorm
90b9fafa29 New build files for the weekend :) 2014-04-17 14:59:04 +01:00
clark-stevenson
0063c85c86 Update phaser.d.ts
Recent additions.
2014-04-15 20:11:24 +01:00
photonstorm
1326e40598 Build files + docs update. 2014-04-15 15:39:23 +01:00
photonstorm
5f455791d4 TypeScript defs update (thanks @cheshirepuss42, ping to @clark-stevenson to ensure merge with his master version :) 2014-04-15 03:24:54 +01:00
clark-stevenson
af42813a36 Update phaser.d.ts
#715

Added OnFileStart signal to loader
2014-04-14 11:44:32 +01:00
clark-stevenson
4167e9ab00 Update phaser.d.ts
#95b0532
#770ced8
#780fb48
#a01cc2e
#b7b1e74  <-- Not sure how to handle src/utils/Utils.js Array.prototype.forEach
2014-04-13 19:43:13 +01:00
photonstorm
4cea8d7bcc Preparing for final 2.0.3 release. Updated docs, readme and build files. 2014-04-11 13:09:28 +01:00
photonstorm
a2b2d558a5 jsdoc and jshint fixes. 2014-04-11 03:02:19 +01:00
photonstorm
fab18dd80d Modified Phaser.Animation.generateFrameNames to make it a static function (fix #701) 2014-04-10 04:31:27 +01:00
Richard Davey
d05ac487c6 Merge pull request #698 from clark-stevenson/patch-1
generateFrameNames returns string[]
2014-04-10 04:28:54 +01:00
photonstorm
8c434a83ab Fixed issue with Particles not being updated by the Emitter and rebuilt the dist files. 2014-04-10 04:19:43 +01:00
photonstorm
2f46a9c274 Removed un-used builds. 2014-04-10 01:54:52 +01:00
photonstorm
523a3c5632 Tidied up the Grunt tasks a little to name them more accurately.
Renamed phaser-no-physics to phaser-arcade-physics, which is far more accurate.
2014-04-10 01:54:30 +01:00
clark-stevenson
5137834886 generateFrameNames returns string[]
#697
2014-04-09 21:05:07 +01:00
photonstorm
50981fd729 Emitter now has minParticleAlpha and maxParticleAlpha values for setting a random alpha on emitted particles.
Emitter.particleAnchor allows you to control the anchor of emitted Particles. Defaults to 0.5 (same as before) but now under your control.
Emitter now emits Phaser.Particle objects instead of Phaser.Sprites, which can be extended as required.
Emitter has had various local properties removed that were already declared in Phaser.Group which it extends.
2014-04-09 14:29:23 +01:00
photonstorm
8fc2a465cd New Phaser package, small docs updates and preparing P2.World for new bounds code and v0.5.0 migration. 2014-04-08 03:31:13 +01:00
photonstorm
451f68be96 Updated p2 to 6abc900ff9 (which has probably broken stuff, but we'll test it tomorrow). 2014-04-08 03:30:45 +01:00
clark-stevenson
d319cd8cb3 Update phaser.d.ts
Updated for last week of dev.
2014-04-03 20:13:35 +01:00
photonstorm
4d06298e64 Fixed silly SoundManager bug :) 2014-04-01 19:51:48 +01:00
photonstorm
f4dc686028 New build files for testing. 2014-04-01 16:13:00 +01:00
photonstorm
fca1bd97fd New build to test state change in. Also various Gruntfile fixes that arose from the tasks split. 2014-04-01 03:02:36 +01:00
clark-stevenson
6041c137af Small additions from the past week. 2014-03-28 16:58:23 +00:00
photonstorm
5b73bb21bb Sprite would glitch if it had an ArcadePhysics Body that was re-positioned out of loop.
Sprite would "fly off" if it had an ArcadePhysics Body that was re-positioned during an input handler.
Newly generated docs
2014-03-28 01:42:49 +00:00
photonstorm
953ae83350 Updated TS defs (fix #650) 2014-03-26 13:24:11 +00:00
photonstorm
75cc6a7365 Added World.setBounds to the TypeScript defs (fix #649) 2014-03-26 11:00:15 +00:00
keyle
163d8fa964 Fixed typo in typescript defs 2014-03-26 19:05:36 +10:00
photonstorm
344ab46d78 Line.fromSprite now sets "fromCenter" to false by default as Sprite.center is deprecated in 2.x. Documentation and Examples updated to reflect this. 2014-03-25 12:44:20 +00:00
photonstorm
87a0fb86b8 All Timer events are now increased by the game time on start. 2014-03-24 12:15:14 +00:00
photonstorm
622957c9b0 Timer objects incorrectly set the first tick value on events if you added the events prior to starting them. 2014-03-24 02:25:35 +00:00
photonstorm
26a89f0b84 New build files with tilemap callback fixes in. 2014-03-24 01:39:09 +00:00
photonstorm
49bcd2edd2 Tilemap fixes. 2014-03-24 00:30:05 +00:00
clark-stevenson
daaa99216f Few updates 2014-03-21 23:59:44 +00:00
clark-stevenson
1f37a4e1f5 Update phaser.d.ts
Final one, I went through the source code this time so I know its 99% matching your latest commit brining it upto par with 2 completely.

Congratulations on reaching 2! Phaser is amazing, and without the well documented code, I would be stumped.
2014-03-20 11:07:37 +00:00
photonstorm
634b1d1093 Emitter.friction property removed and replaced with Emitter.particleDrag, which is now correctly applied.
ArcadePhysics.Body.reset incorrectly set the Body.rotation to Sprite.rotation instead of angle.
Emitter.emitParticle resets the rotation on the particle to zero before emitting it.
Lots of fixes to the TypeScript definitions file (thanks as always to clark-stevenson for his tireless work on these)
Emitters now bring the particle they are about to emit to the top of the Group before doing so. Avoids particles hidden behind others.
ArcadePhysics.Body.setSize corrected to take the parameters as positive, not negative values.
ArcadePhysics.Body now checks the Sprite scale automatically and adjusts the body size accordingly (fix #608)
Emitter.particleClass can now be set to any object that extends Phaser.Sprite, which will be emitted instead of a regular Sprite.
2014-03-20 03:48:54 +00:00
Richard Davey
c3778be394 Merge pull request #607 from clark-stevenson/patch-1
Update phaser.d.ts
2014-03-20 00:21:05 +00:00
photonstorm
684ee9c064 ArcadePhysics.Body has a deltaMax object, which allows you to cap the delta applied to the position to +- this value.
ArcadePhysics.Body now checks the Sprite scale automatically and adjusts the body size accordingly (fix #608)
2014-03-20 00:20:02 +00:00
clark-stevenson
7ab37a82f4 Update phaser.d.ts
SAT removed
Physics modules should all be updated correctly #599 
Misc updates from the last week of dev. 

So the TS is upto date and it should be easy to maintain with the latest changes. 

The only thing that bothers me is the historic references to <2.0 and the pre-pixi "any". That kind of thing will be my next update.

My final questions though are these!

1) displayObject: any  can this now be considered PIXI.DisplayObject or should I keep "any"?

2) When an argument can either be a string or a number. Are you stuck with "any" or is there a concept I am missing in TypeScript? It is the same with stuff like "p2.Constraint". In this situation, is it wise to create an IConstraint which all constraints implement, rather than having "any" or is that just even more confusing?

I would like my next pass through to be as acceptable as possible.
2014-03-19 15:09:44 +00:00
photonstorm
22b472ba4d Removed rogue console.log 2014-03-19 13:23:46 +00:00
photonstorm
2d08fab48e When creating a Sprite (via Group.create or directly) with exists = false and a P2 body, the body is not added to the world.
Every Input class now checks to see if it has already been started. If so it doesn't add the listeners again unless they have been nulled.
2014-03-19 13:22:04 +00:00
photonstorm
4bfbd4dc96 2.0.1-19 build files. 2014-03-19 12:12:59 +00:00
photonstorm
5d40365b87 InputHandler.dragFromCenter will now work regardless of the anchor point of the Sprite. 2014-03-19 05:21:26 +00:00
photonstorm
84df7bf320 Sprite.events.onEnterBounds added. This is dispatched if the Sprite leaves the bounds but then returns. The opposite of onOutOfBounds. 2014-03-19 04:17:37 +00:00
photonstorm
2cc1a45f9a Fixed SpriteBounds camera placement in Debug (again).
Removed un-needed cache vars from ArcadePhysics.World.
Tidied up ArcadePhysics.Body and fixed rotation parameters.
Every single Arcade Physics Example now runs perfectly under this release.
2014-03-19 03:55:44 +00:00
photonstorm
9490041c79 ArcadePhysics.separate doesn't pass over to seperateX/Y if overlapOnly is true (fix #604)
ArcadePhysics.collideSpriteVsSprite checks if both objects have bodies before processing.
2014-03-19 02:05:29 +00:00
photonstorm
df4debf2a6 Build update for testing. 2014-03-19 00:57:10 +00:00
photonstorm
8010d245f1 Fixed Grunt script that stopped the P2 constraint classes from building properly. 2014-03-18 18:36:46 +00:00
photonstorm
eec9f70c1c Math.removeRandom allows you to remove (and return) a random object from an array.
Updated TypeScript defs to fix getRandom (fix #583)
2014-03-18 16:51:58 +00:00
photonstorm
a7ff5f884c Added basic Webcam plugin.
Added Device.getUserMedia detection.
Updated config.php so you can toggle physics engines on/off via flags.
Updated Gruntfile.js so it builds a Phaser + Pixi but no Physics libs.
2014-03-18 15:14:28 +00:00
photonstorm
89cdaef84d New build files. 2014-03-18 00:01:39 +00:00
photonstorm
f32dce8cdd New build files. 2014-03-17 21:18:02 +00:00
clark-stevenson
868f128978 Basic p2 added
Will maybe be sketchy (a few Any's - p2.Shape or p2.Constraint etc). Also I may have messed up a couple of types (Phaser.Physics.p2.Body vs p2.Body).

Also fixed #585
2014-03-17 12:35:14 +00:00
clark-stevenson
1152fe6ee2 Ninja Physics Added 2014-03-16 15:21:22 +00:00
photonstorm
44a5741148 Fixed games. Updated Body.moves handling. 2014-03-14 04:49:55 +00:00
alvinsight
726c42310a Yeaah, 242 examples working, only 7 missing 2014-03-13 17:32:55 +00:00
alvinsight
8a4d5ab8fd Updated all the examples that were using the old physicsEnabled 2014-03-13 17:32:54 +00:00
photonstorm
c2d38fe16b jshint passed all the p2 physics and fixed Debug.spriteBounds. 2014-03-13 16:16:14 +00:00
alvinsight
c9f89f5a3b New examples for ninja physics, bitmap text, and documented the map function 2014-03-13 13:25:39 +00:00
photonstorm
87684bb15f Revolute Constraint done. 2014-03-13 12:14:14 +00:00
photonstorm
6b55fea953 Distance and Gear constraints done. 2014-03-13 11:13:22 +00:00