Commit graph

562 commits

Author SHA1 Message Date
alvinsight
1d897753c8 Added the new gravity scale 2014-03-10 11:45:35 +00:00
alvinsight
d09da54dd3 Updated the arcade physics examples according to the lastest changes 2014-03-10 11:37:46 +00:00
photonstorm
8fff38618d Tidied up the Examples, fixed Arcade Physics Body, added Body enable support to Group and fixed QuadTree. 2014-03-10 03:06:28 +00:00
photonstorm
4db1fc0079 Restored Phaser.QuadTree - should get all remaining Arcade Physics examples working again. 2014-03-07 15:14:53 +00:00
photonstorm
480c1819d6 Working through AABB vs. AABB tests. 2014-03-07 05:30:56 +00:00
photonstorm
4cac6408d8 Ninja.AABB updated with all the correct properties, now works fully as with Circle. Created new tests, all Ninja shapes now set Body.touching values correctly. TileSprites work as bodies. Trying out AABB vs. AABB collision now. 2014-03-07 04:43:55 +00:00
photonstorm
a51ae03246 Tweens are now bound to their own TweenManager, not always the global game one. So you can create your own managers now (for you clark :) 2014-03-07 01:26:09 +00:00
photonstorm
3b2573de9a Objects that are 'fixedToCamera' are now still correctly placed even if the camera is scaled (#512) 2014-03-06 17:12:12 +00:00
photonstorm
512b542e50 Fixed gruntfile and included new labs demo. 2014-03-06 10:01:46 +00:00
photonstorm
6815c5909a New tiles and new map test. 2014-03-06 09:48:42 +00:00
photonstorm
e97a207816 Added in Circle to the Ninja physics system. 2014-03-06 07:18:59 +00:00
photonstorm
3e93f24583 New split physics system is implemented. Still tidying-up, but ArcadePhysics, P2 and Ninja Physics are in and configured. Lots more examples required, and tilemap collision mostly broken in Arcade at the moment. Time to implement in Ninja. 2014-03-06 06:29:19 +00:00
photonstorm
2bab4fd2fb Testing lines. 2014-03-05 04:40:37 +00:00
photonstorm
12a2a2ec16 Testing map collision 2014-03-05 03:18:24 +00:00
photonstorm
22b1ce9b9d Added Phasers new Physics Manager and restored the pre-1.1.4 ArcadePhysics system. The new manager can handle multiple physics systems running in parallel, which could be extremely useful for lots of games. 2014-03-05 02:36:08 +00:00
photonstorm
cc82336952 Adding in TweenGroup for wip dev. 2014-03-04 03:31:20 +00:00
photonstorm
5a6ae5f696 Tilemap.putTile now correctly re-calculates the collision data based on the new collideIndexes array (fixes #371)
Tilemap.putTile can now insert a tile into a null/blank area of the map (before it could only replace existing tiles)
2014-03-04 03:08:35 +00:00
photonstorm
8c2502d37d Group.xy(index, x, y) allows you to set the x and y coordinates of a Group child at the given index.
Group.reverse() reverses the display order of all children in the Group.
New labs demo.
Fixed some Easing docs issues.
2014-03-04 01:27:57 +00:00
photonstorm
67ad898294 Tween.generateData(frameRate) allows you to generate tween data into an array, which can then be used however you wish (see new examples)
Added new Retro Font examples.
2014-03-03 22:43:35 +00:00
photonstorm
7183322259 Renamed Phaser.BitmapFont to Phaser.RetroFont because I believe it will cause confusion otherwise. Also tidied up the asset fonts folder. 2014-03-03 17:05:28 +00:00
photonstorm
833960b3c8 Animation.looped has been renamed to Animation.loop. It's a boolean you can toggle at run-time to turn on/off animation looping.
A single Animation object now has 3 new events: onStart, onLoop and onComplete.
Animation.loopCount holds the number of times the animation has looped since it last started.
Animation.stop has a new parameter: dispatchComplete. If true it'll dispatch an Animation.onComplete event.
2014-03-03 16:05:55 +00:00
photonstorm
4a370c82cf You can now load in CSV Tilemaps again and they get created properly (fixes #391)
You can now create blank Tilemaps and then populate them with data later.
2014-03-03 13:45:47 +00:00
photonstorm
960e8cace6 Updated blank tilemap example with painting tool. 2014-03-03 11:40:40 +00:00
photonstorm
d8f5832fa2 Completely empty Tilemaps can now be created. This allows for dynamic map generation at runtime.
Loads of updates across most the Tilemap files. Not finished yet, still CSV loading to do and a multi-tileset issue to resolve, but it's a lot more flexible now.
2014-03-03 05:19:46 +00:00
photonstorm
6f513042c1 Tween no longer copies all the object properties into the _valuesStart object on creation.
Fixed shadow bug in Debug.text
Fixed tween examples.
2014-03-03 02:40:59 +00:00
photonstorm
61376093fd Updated all the examples to use the new Debug methods. 2014-03-03 01:19:31 +00:00
photonstorm
c4a68e3e87 The Debug panel now works in WebGL mode. Pay attention to the warning at the top of the Debug docs (feature request #499)
All the Debug methods have had the word 'render' removed from the start. So where you did `debug.renderSpriteInfo` before, it's now just `debug.spriteInfo`.
Debug methods that rendered geometry (Rectangle, Circle, Line, Point) have been merged into the single method: `Debug.geom`.
2014-03-03 00:46:03 +00:00
photonstorm
418a161b46 Testing webgl debug overlay. 2014-03-02 20:51:44 +00:00
photonstorm
442e6bb776 Events.onInputUp would be dispatched twice if the Sprite had drag enabled, now only dispatched once (thanks Overbryd, fixes #502)
Changed webfont URI back to //
2014-03-02 11:31:26 +00:00
Richard Davey
a7dbd6e626 Merge pull request #498 from alvinsight/1.2
Examples updated
2014-03-02 11:23:59 +00:00
photonstorm
0eb23d4b11 RandomDataGenerator.integerInRange(min, max) now includes both min and max within its range (#501) 2014-03-02 11:21:30 +00:00
photonstorm
8dcfef8db0 Updated to latest Pixi build (can do away with our own local patch now).
Group.sendToBottom(child) is the handy opposite of Group.bringToTop()
Group.moveUp(child) will move a child up the display list, swapping with the child above it.
Group.moveDown(child) will move a child down the display list, swapping with the child below it.
2014-02-28 18:55:07 +00:00
alvinsight
27cea5e6f0 Tidying up a bit 2014-02-28 18:40:06 +00:00
alvinsight
f17cdd9c32 Updated a lot of examples to Phaser 2.0 :) 2014-02-28 18:22:52 +00:00
photonstorm
8662cd2fd4 Brand new Grunt task - creates each core library as its own file and a combined phaser.js.
New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!).
phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself.
Fixed silly instanceof bug in game objects (sorry guys).
2014-02-28 09:30:53 +00:00
photonstorm
e45a929b00 Body.loadPolygon now parses all shapes that may exist in a JSON data file, and re-creates them all on the Body. Assumes shapes are CCW + Convex (tested working with Lime Exportor). Almost fixes #449 but Body rotation seems to screw orientation of shapes. 2014-02-28 05:46:02 +00:00
photonstorm
8dc28f4800 Animation.speed added. You can now change the animation speed on the fly, without re-starting the animation (feature request #458) 2014-02-28 04:32:12 +00:00
photonstorm
e3d53ad6a3 Game no longer pauses if you've forced orientation and change it, also doesn't resize a NO_SCALE game.
If the game was set to NO_SCALE and you swapped orientation, it would pause and resize, then fail to resize when you swapped back (thanks starnut, fixes #258)
2014-02-28 04:15:28 +00:00
photonstorm
09d4a35b7f Fixed issue where Phaser.Canvas.create would always make a screencanvas for CocoonJS, but that should only happen once. New parameter toggles it. 2014-02-28 03:55:06 +00:00
photonstorm
34ee2b0b20 Fixed issue with CocoonJS detection in Device.
Fixed docs issue in Tilemap.
Created landscape pointer test, confirmed working fine (issue #276)
2014-02-28 03:09:04 +00:00
photonstorm
43cd5e4b3f Fixed the Tunnel filter. Had to patch Pixi to do it :( But no other choice for now until they merge my pull request. 2014-02-27 23:28:28 +00:00
photonstorm
3568dc4ff1 Pixi GrayFilter ported over (thanks nickryall #404)
Fixed Time.totalElapsedSeconds, which gets the other filters working again too.
2014-02-27 22:35:06 +00:00
photonstorm
5c30fd019f Stage.smoothed was returning the opposite of its actual setting (#494) 2014-02-27 21:56:47 +00:00
photonstorm
7e12075be1 Buttons are now cleanly destroyed if part of a Group without leaving their InputHandler running.
You can now safely destroy a Group and the 'destroyChildren' boolean will propogate fully down the display list.
Calling destroy on an already destroyed object would throw a run-time error. Now checked for and aborted.
Calling destroy while in an Input Event callback now works for either the parent Group or the calling object itself.
In Group.destroy the default for 'destroyChildren' was false. It's now `true` as this is a far more likely requirement when destroying a Group.
All GameObjects now have a 'destroyChildren' boolean as a parameter to their destroy method. It's default is true and the value propogates down its children.
2014-02-27 20:05:16 +00:00
photonstorm
53c10ca31f The grunt task now creates an optional version of Phaser without any Physics support built in. Quite a bit smaller now.
The grunt task now has a new `noUmd` option which builds Phaser without the UMD wrapper.
2014-02-27 17:00:14 +00:00
photonstorm
4d284029c7 Tweens now resume correctly if the game pauses (focus loss) while they are paused.
Tweens don't double pause if they were already paused and the game pauses.
2014-02-26 23:27:22 +00:00
photonstorm
86374d4437 Phaser.Timer will no longer resume if it was previously paused and the game loses focus and then resumes (fixes #383)
Phaser.Timer.stop has a new parameter: clearEvents (default true), if true all the events in Timer will be cleared, otherwise they will remain (fixes #383)
2014-02-26 20:12:17 +00:00
photonstorm
db090601b8 The Timer will no longer create negative ticks during game boot, no matter how small the Timer delay is (fixes #366) 2014-02-26 19:52:23 +00:00
photonstorm
d0fa50f014 Fixed issue stopping SoundManager.volume from working correctly on a global volume basis (fix # 488) 2014-02-26 14:40:55 +00:00
photonstorm
4a97861ff8 Updated p2 2014-02-26 06:27:44 +00:00
photonstorm
5ab104ad4b Loader.script now has callback (and callbackContext) parameters, so you can specify a function to run once the JS has been injected into the body. 2014-02-26 02:45:06 +00:00
photonstorm
994eaff92b StateManager fixes for when you change state in the create function.
TilemapLayer update for WebGL.
2014-02-26 00:58:19 +00:00
photonstorm
d958b34f43 New build. 2014-02-25 23:20:06 +00:00
photonstorm
db2e3733c2 Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
Fullscreen mode now works in Internet Explorer and uses the new fullscreen non-prefix call.
2014-02-25 21:16:56 +00:00
photonstorm
741249043c ScaleManager has 2 new events: ScaleManager.enterFullScreen and ScaleManager.leaveFullScreen, so you can respond to fullscreen changes directly.
Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
2014-02-25 17:10:37 +00:00
photonstorm
be27442139 Fixed Fullscreen example and State preloading. 2014-02-25 16:26:11 +00:00
photonstorm
13c99f3491 Phaser.StageScaleMode has been renamed to ScaleManager and moved from the system folder to the core folder. It's still available under game.scale.
If your game references the old Phaser.StageScaleMode consts like SHOW_ALL you need to update them to Phaser.ScaleManager, i.e. Phaser.ScaleManager.SHOW_ALL.
All of the Project Templates have been updated to reflect the above change.
2014-02-25 14:46:48 +00:00
photonstorm
b4dbaf9950 StateManager.start can now have as many parameters as you like. The order is: start(key, clearWorld, clearCache, ...) - they are passed to State.init() (NOT create!) 2014-02-25 11:56:57 +00:00
photonstorm
a24d252430 Fixed issue where Stage.update wasn't called. 2014-02-25 04:58:09 +00:00
photonstorm
a1b502fc06 Stage.smoothed allows you to set if sprites will be smoothed when rendered. Set to false if you're using pixel art in your game. Default is true. Works in Canvas and WebGL. Setting the game anti-aliased parameter now works properly too.
Sprite.smoothed and Image.smoothed allows you to set per-Sprite smoothing, perfect if you just want to keep a few sprites smoothed (or not).
Fixes #381.
2014-02-25 04:41:57 +00:00
photonstorm
8fb2f20482 Swapping between tabs will pause and resume tweens correctly, allowing their onComplete events to still fire (fixes #292) 2014-02-25 03:33:47 +00:00
photonstorm
cc06a62b90 Pausing the game will now mute audio and resuming will un-mute, unless it was muted via the game (fixes #439) 2014-02-25 03:12:12 +00:00
photonstorm
415342d986 Vastly improved visibility API support + pageshow/pagehide + focus/blur. Working across Chrome, IE, Firefox, iOS, Android (also fixes #161) 2014-02-25 02:59:24 +00:00
photonstorm
beaac18b8f Active animations now monitor if the game pauses, and resume normally when the game un-pauses (fixes #179) 2014-02-24 23:06:45 +00:00
photonstorm
a25f6dbc3b Physics.processRebound now takes Body direction into account, helps with body-body collision bounces (thanks ram64)
Fixed the Example / physics / mass velocity test.
Fixed readme typo.
2014-02-24 21:43:02 +00:00
photonstorm
d9cadc70ac The Keyboard class has had a complete overhaul. Phaser.Key objects are created automatically, there are fixes against duration and keys reset properly on visibility loss.
Keyboard.removeKey has been removed. The way the new keyboard manager works means it's no longer required.
Fixes issue #462
2014-02-24 15:58:02 +00:00
photonstorm
f4ff4d88fe 1.1.6 release. The final of the 1.1 branch. 2014-02-24 01:28:13 +00:00
photonstorm
e266ecfe00 Starting timer tests. 2014-02-22 00:17:41 +00:00
photonstorm
57796a60be TileSprites can now receive full Input events, dragging, etc and be positioned in-world and fixed to cameras (fixes #321) 2014-02-21 19:21:00 +00:00
Richard Davey
ee1a1cd1c9 Merge pull request #468 from alvinsight/1.2
Examples updated :)
2014-02-21 18:59:34 +00:00
photonstorm
1448562abd Loader can now load JSON files specifically (game.load.json) and they are parsed and stored in the Game.Cache. Retrieve with game.cache.getJSON(key) (#329)
Also fixed UTF encoding on the animation file.
2014-02-21 18:48:06 +00:00
alvinsight
b03c6231e1 And some more examples updated :) 2014-02-21 17:59:13 +00:00
alvinsight
2669f81391 Debug functions ? Seems last commit didn't work 2014-02-21 17:59:13 +00:00
alvinsight
2eab5d4815 Debug functions and more examples 2014-02-21 17:59:12 +00:00
alvinsight
7342ce603a Velocity is back on track :) 2014-02-21 17:59:11 +00:00
photonstorm
3ac8fba9e8 Body.x/y didn't use pxpi. Also fixed out of bounds example. 2014-02-21 16:35:37 +00:00
photonstorm
e9e5bf9436 Updated docs - they now actually list the new body methods :) 2014-02-21 15:37:26 +00:00
photonstorm
d7ababa398 BitmapData.alphaMask will draw the given image onto a BitmapData using an image as an alpha mask. 2014-02-21 15:09:04 +00:00
photonstorm
07af06fc4e Fixing up documentation, missing functions, examples and alpha masks. 2014-02-21 14:50:18 +00:00
photonstorm
91c0299d4c Fixed issues with the contacts and world bounds. New labs demo created. 2014-02-20 04:21:14 +00:00
photonstorm
aac31bdaa4 debug#renderShapeConvex fixed, fix in p2 physics body creation #446 2014-02-19 15:43:05 +00:00
photonstorm
1d3616f52c Do not invert (physics) shape size data for circle, rectangle, capsuel & line #445 2014-02-19 15:21:03 +00:00
photonstorm
5f79bb4330 Fix typos of method names in Button.js for doc #444 2014-02-19 15:01:59 +00:00
photonstorm
d9080052c3 Disabled World bounds by default.
Body.collides now takes a group level callback.
Added Body.createBodyCallback and Body.createGroupCallback.
2014-02-19 05:22:37 +00:00
photonstorm
7373db6e8c Upgraded p2 to latest build. 2014-02-19 03:58:24 +00:00
photonstorm
08e5f18257 Fixed some doc typos.
You can now pass a physicsConfig object with the game constructor that is given to p2.World, allowing you to set the broadphase, etc.
2014-02-19 03:51:48 +00:00
photonstorm
d057a9fe11 Device, Canvas and GamePad classes all updated for better CocoonJS support (thanks Videlais) 2014-02-19 02:45:42 +00:00
photonstorm
14646e811c QuadTree deprecated and moved to plugins. Body.collideWorldBounds added back and working. CollisionGroups pretty much finished. 2014-02-19 02:12:27 +00:00
photonstorm
5968dd053b CollisionGroup and collision masks working. Need to refine a little, but all the essentials are there. 2014-02-19 01:51:14 +00:00
photonstorm
7a8c96db37 Working gravity + contacts + platformer demo :) 2014-02-18 17:25:54 +00:00
photonstorm
63145d7735 New labs demo. Added moveForward and moveBackward to Body. 2014-02-18 04:49:03 +00:00
photonstorm
5d5c64d22f Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world.
After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required.
Debug.renderPhysicsBody updated to take camera location and body rotation into account.
Body movement functions put back to velocity :)
Updated to latest dev version of pixi and latest p2.js
Updated docs
2014-02-18 03:01:51 +00:00
photonstorm
375e9e379a Fixed issue with trimmed JSON Hash texture atlases not parsing correctly. 2014-02-17 19:58:45 +00:00
photonstorm
cad14848e8 Removed input handler from Graphics as it's just meant to be used as a texture really, if you need input events you can apply Graphics to a Sprite.
You can now create a Physics Body directly via game.physics.createBody(), and Body has been updated so it's no longer always bound to a Sprite.
Debug.renderPhysicsBody now works with Rectangles, Lines and multiple Convex shapes.
Starting to get the Tiled polyline parsing working nicely. Not too far off a complete tilemap collision.
2014-02-17 17:54:10 +00:00
photonstorm
78bf874888 Fresh build. Added pre/post update hooks to Graphics. 2014-02-17 11:27:31 +00:00
photonstorm
d026f968de You can now set the Stage.backgroundColor using either hex or numeric values. 2014-02-16 14:54:04 +00:00
photonstorm
3a59c13a71 Added hostname: '*' to the grunt-connect in Gruntfile.js (fixes #426) 2014-02-15 19:03:43 +00:00
photonstorm
85eaaef688 Filters fixed to work with Pixi 1.5. 2014-02-15 03:12:24 +00:00
photonstorm
9837984a4d Working Springs demo. 2014-02-15 02:56:24 +00:00
photonstorm
e5812710cc Added Spring class. Fixed reason why World wasn't pre and post updating (Stage didn't have an exists property). 2014-02-15 02:19:37 +00:00