Commit graph

909 commits

Author SHA1 Message Date
photonstorm
c6c5856dec Phaser.Graphics.drawCircle now overrides PIXI.drawCircle which means the docs are now correct re: diameter not radius (thanks @ethankaminski #1454) 2014-12-17 13:44:12 +00:00
photonstorm
f23c0aa24b Removed redundant tolerance parameter from Rectangle.intersects (thanks @toolness #1463) 2014-12-17 13:25:21 +00:00
photonstorm
269af69da5 Added extra checks to Sound.play to stop it throwing DOM Exception Error 11 if the sound.readyState wasn't set or the sound was invalid. Also wrapped stop() call in a try catch`. 2014-12-17 13:07:19 +00:00
photonstorm
5029427e14 Tween.stop fired a different set of onComplete parameters to Tween.update. Both now dispatch onComplete(target, tween) as the parameters in that order (thanks @P0rnflake #1450) 2014-12-15 09:42:18 +00:00
photonstorm
3c564a33b6 The P2 World constructor wouldn't let you use your own config unless you specified both the gravity *and* broadphase. Now allows one or both (thanks @englercj #1412) 2014-12-11 22:04:45 +00:00
photonstorm
93e0d2f3b1 Docs update. 2014-12-11 22:00:06 +00:00
photonstorm
0cd0a5bd9b Phaser 2.2.3 Build Files for testing. 2014-12-11 09:26:14 +00:00
photonstorm
8d9e1196c0 readme update. 2014-12-09 15:27:26 +00:00
photonstorm
38a224df3e Tween.delay, Tween.repeat and Tween.yoyo will no longer throw an error if called before a TweenData object has been created (via Tween.to or Tween.from) (thanks @SomMeri #1419) 2014-12-07 11:31:48 +00:00
photonstorm
e7f3b9188e Preparing for Phaser 2.2.2 development. 2014-12-04 11:49:53 +00:00
photonstorm
d206e3c2d5 Docs update. 2014-12-04 11:28:02 +00:00
photonstorm
847cde81a9 Custom Particle classes that used a BitmapData wouldn't work (thanks @hardalias #1402) 2014-12-03 20:59:44 +00:00
photonstorm
3371f9ff1e Added Game.debug reset method for when the debug manager is disabled (thanks @DanielSitarz #1407) 2014-12-03 20:56:39 +00:00
photonstorm
1227232fd6 Updated readme. 2014-12-03 20:54:25 +00:00
photonstorm
e271c63ca6 Preparing for Phaser 2.2.1. 2014-12-03 13:41:48 +00:00
photonstorm
95ffa83e34 Phaser 2.2.0 Docs. 2014-12-03 10:39:20 +00:00
photonstorm
35e2893db4 Game.lockRender is a new property. If false Phaser will automatically render the display list every update. If true the render loop will be skipped. You can toggle this value at run-time to gain exact control over when Phaser renders. This can be useful in certain types of game or application. Please note that if you don't render the display list then none of the game object transforms will be updated, so use this value carefully. 2014-12-02 09:03:55 +00:00
photonstorm
def662f28f Text.setShadow has had the default color value changed from rgba(0,0,0,0) to rgba(0,0,0,1) so it appears as a black shadow by default - before the alpha channel made it invisible. 2014-12-02 09:03:55 +00:00
photonstorm
5b6e41b112 Readme updated. 2014-12-02 09:03:55 +00:00
photonstorm
30d2d1973a readme update. 2014-11-27 21:33:21 +00:00
photonstorm
fb733ddcca onPreRenderCallback wasn't being cleared on a State swap. 2014-11-26 13:12:51 +00:00
photonstorm
667d477a16 P2.BodyDebug always lagged behind the position of the Body it was tracking by one frame, which became visible at high speeds. It now syncs its position in the Body.postUpdate which prevents this from happening (thanks @valueerror) 2014-11-25 22:21:11 +00:00
photonstorm
e86f00eb55 Text.lineSpacing works correctly again. Before no space was added between the lines (thanks @intimidate #1367 and @brejep #1366) 2014-11-25 17:06:17 +00:00
photonstorm
72eaee3139 Adjusted Sprite.preUpdate to remove the lifespan calculation. 2014-11-25 14:18:18 +00:00
photonstorm
7aaa63e7a5 When you change State the P2 Physics world is no longer fully cleared. All of the bodies, springs, fixtures, materials and constraints are removed - but config settings such as gravity, restitution, the contact solver, etc are all retained. The P2.World object is only created the very first time you call Physics.startSystem. Every subsequent call hits P2.World.reset instead (#1292) 2014-11-25 12:09:03 +00:00
photonstorm
54e79f5b25 Grunt and docs updates. 2014-11-25 00:24:29 +00:00
photonstorm
4ecd7f99a8 Docs update. 2014-11-24 11:12:09 +00:00
photonstorm
1928427bcb Phaser TypeScript defs fixes. 2014-11-23 11:32:13 +00:00
photonstorm
874f60c1bc Removed CocoonJS hack - woohoo! 2014-11-21 10:40:18 +00:00
photonstorm
7e4a494f13 Keyboard.justPressed has bee renamed to Keyboard.downDuration which is a much clearer name for what the method actually does.
Keyboard.justReleased has bee renamed to Keyboard.upDuration which is a much clearer name for what the method actually does.
Keyboard.downDuration, Keyboard.upDuration and Keyboard.isDown now all return `null` if the Key wasn't found in the local keys array.
2014-11-20 20:55:51 +00:00
photonstorm
88ea3412dc Fixes issue where Tween.from didn't set the target properties until after the delay was up. 2014-11-20 20:42:10 +00:00
photonstorm
2589000435 Tweens have been completely rewritten. They're now much more flexible and efficient than before:
When specifying the ease in `Tween.to` or `Tween.from` you can now use a string instead of the Function. This makes your code less verbose. For example instead of `Phaser.Easing.Sinusoidal.Out` and you can now just use the string "Sine".The string names match those used by TweenMax and includes: "Linear", "Quad", "Cubic", "Quart", "Quint", "Sine", "Expo", "Circ", "Elastic", "Back", "Bounce", "Power0", "Power1", "Power2", "Power3" and "Power4". You can append ".easeIn", ".easeOut" and "easeInOut" variants. All are supported for each ease types.
Tweens now create a TweenData object. The Tween object itself acts like more of a timeline, managing multiple TweenData objects. You can now call `Tween.to` and each call will create a new child tween that is added to the timeline, which are played through in sequence.
Tweens are now bound to the new Time.desiredFps value and update based on the new Game core loop, rather than being bound to time calculations. This means that tweens are now running with the same update logic as physics and the core loop.
Tween.timeScale allows you to scale the duration of a tween (and any child tweens it may have). A value of 1.0 means it should play at the desiredFps rate. A value of 0.5 will run at half the frame rate, 2 at double and so on. You can even tween the timeScale value for interesting effects!
Tween.reverse allows you to instantly reverse an active tween. If the Tween has children then it will smoothly reverse through all child tweens as well.
Tween.repeatAll allows you to control how many times all child tweens will repeat before firing the Tween.onComplete event. You can set the value to -1 to repeat forever.
Tween.loop now controls the looping of all child tweens.
Tween.onRepeat is a new signal that is dispatched whenever a Tween repeats. If a Tween has many child tweens its dispatched once the sequence has repeated.
Tween.onChildComplete is a new signal that is dispatched whenever any child tweens have completed. If a Tween consists of 4 sections you will get 3 onChildComplete events followed by 1 onComplete event as the final tween finishes.
Chained tweens are now more intelligently handled. Because you can easily create child tweens (by simply calling Tween.to multiple times) chained tweens are now used to kick-off longer sequences. You can pass as many Tween objects to `Tween.chain` as you like as they'll all be played in sequence. As one Tween completes it passes on to the next until the entire chain is finished.
Tween.stop has a new `complete` parameter that if set will still fire the onComplete event and start the next chained tween, if there is one.
Tween.delay, Tween.repeat, Tween.yoyo, Tween.easing and Tween.interpolation all have a new `index` parameter. This allows you to target specific child tweens, or if set to -1 it will update all children at once.
Tween.totalDuration reports the total duration of all child tweens in ms.
There are new easing aliases:
* Phaser.Easing.Power0 = Phaser.Easing.Linear.None
* Phaser.Easing.Power1 = Phaser.Easing.Quadratic.Out
* Phaser.Easing.Power2 = Phaser.Easing.Cubic.Out
* Phaser.Easing.Power3 = Phaser.Easing.Quartic.Out
* Phaser.Easing.Power4 = Phaser.Easing.Quintic.Out
2014-11-20 06:06:26 +00:00
photonstorm
aa72cf63c1 Emitter.setScale fixed minX minY order presedence (thanks spayton) 2014-11-18 15:38:08 +00:00
photonstorm
07d43934c6 Docs update. 2014-11-18 12:43:26 +00:00
photonstorm
21479acd8e Sprite.autoCull now properly works if the camera moves around the world.
Sprite.inCamera uses a much faster check if auto culling or world bounds checks are enabled and properly adjusts for camera position.
2014-11-18 12:29:55 +00:00
photonstorm
5cd4225412 If you are reloading a Phaser Game on a page that never properly refreshes (such as in an AngularJS project) then you will quickly run out of AudioContext nodes. If this is the case create a global var called PhaserGlobal on the window object before creating the game. The active AudioContext will then be saved to window.PhaserGlobal.audioContext when the Phaser game is destroyed, and re-used when it starts again (#1233) 2014-11-16 21:05:31 +00:00
photonstorm
b635ca511e docs update 2014-11-16 19:13:53 +00:00
photonstorm
02665076e6 Docs updates. 2014-11-15 19:50:03 +00:00
photonstorm
d8d2ebdb31 Phaser 2.2.0 - Release Candidate 6. 2014-11-14 08:16:55 +00:00
photonstorm
527934d909 Key.justPressed has bee renamed to Key.downDuration which is a much clearer name for what the method actually does. See Key.justDown for a nice clean alternative.
Key.justReleased has bee renamed to Key.upDuration which is a much clearer name for what the method actually does. See Key.justUp for a nice clean alternative.
Key.justDown allows you to test if a Key has just been pressed down or not. You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. This allows you to use it in situations where you want to check if this key is down without using a Signal, such as in a core game loop (thanks @pjbaron #1321)
Key.justUp allows you to test if a Key has just been released or not. You can only call justUp once per key press. It will only return `true` once, until the Key is pressed down and released again. This allows you to use it in situations where you want to check if this key is up without using a Signal, such as in a core game loop (thanks @pjbaron #1321)
2014-11-13 13:01:58 +00:00
photonstorm
b855df2656 Docs update. 2014-11-13 12:39:32 +00:00
photonstorm
e7356fc575 Pixi 2.1.1 merge. 2014-11-12 22:38:51 +00:00
photonstorm
515dff3b04 docs updated 2014-11-12 22:28:49 +00:00
photonstorm
1352b526c7 Merged final Pixi v2.1.0 release. 2014-11-11 23:24:50 +00:00
photonstorm
da031d8bbb Phaser games should now work again from the CocoonJS Launcher. 2014-11-11 14:31:20 +00:00
photonstorm
042ceeb59d Docs update. 2014-11-11 05:56:38 +00:00
photonstorm
bf70df2658 Game.forceSingleUpdate will force just a single logic update, regardless of the delta timer values. You can use this in extremely heavy CPU situations where you know you're about to flood the CPU but don't want Phaser to get stuck in a spiral. 2014-11-11 05:51:56 +00:00
photonstorm
a2b7d339a2 Tilemap.createFromTiles will convert all tiles matching the given tile index (or an array of indexes) into Sprites. You can optionally then replace these tiles if you wish. This is perfect for games when you want to turn specific tiles into Sprites for extra control. The Sprites have an optional properties object which they can be populated with. 2014-11-11 01:05:59 +00:00
photonstorm
8bf93fb658 ArcadePhysics.skipQuadTree is now set to true by default. A QuadTree is a wonderful thing if the objects in your game are well spaced out. But in tightly packed games, especially those with tilemaps or single-screen games, they are a considerable performance drain and eat up CPU. We've taken the decision to disable the Arcade Physics QuadTree by default. It's all still in there and can be re-enabled via game.physics.arcade.skipQuadTree = false, but please only do so if you're sure your game benefits from this. 2014-11-11 01:05:58 +00:00
photonstorm
547e7a4d1d docs update 2014-11-09 23:15:30 +00:00