Commit graph

321 commits

Author SHA1 Message Date
Georgios Kaleadis
c686ea0eb5 fixed naming for rotation lock in prismatic joint 2014-03-21 14:13:06 +01:00
Richard Davey
f0034008f5 Merge pull request #614 from georgiee/physics-phaser-exporter
Custom PhysicsEditor export & new p2 polygon parsing
2014-03-21 11:27:13 +00:00
photonstorm
b9fcda73ca ArcadePhysics.World.seperate will now check gravity totals to determine separation order. You can set World.forceX to true to always separate on X first and skip this check. 2014-03-21 11:22:56 +00:00
Georgios Kaleadis
f56f1674f7 pivots were wrong signed, everything was upside down 2014-03-21 09:49:51 +01:00
Georgios Kaleadis
a4982fa6e2 better fixture handling 2014-03-20 19:38:47 +01:00
Georgios Kaleadis
277afa1415 method docs 2014-03-20 15:46:54 +01:00
Georgios Kaleadis
af847de963 reverted p2 body debug 2014-03-20 15:44:41 +01:00
Georgios Kaleadis
45a41af766 exporter update 2014-03-20 15:27:50 +01:00
Georgios Kaleadis
66fa003901 custom export from physics editor 2014-03-20 13:38:25 +01: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
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
Georgios Kaleadis
5b78c5c46e fixed wrong motion state constants in phaser p2 body 2014-03-19 22:56:26 +01:00
photonstorm
164f3cbe83 When creating a Sprite (via Group.create or directly) with exists = false and a P2 body, the body is not added to the world. 2014-03-19 13:09:29 +00:00
photonstorm
0a42ac39b9 ArcadePhysics.World now has a checkCollision object which can be used to toggle collision against the 4 walls of its bounds. 2014-03-19 04:03:21 +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
79ffda3f18 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.
ArcadePhysics.Body now checks the ArcadePhysics.World bounds, not the game bounds.
ArcadePhysics.Body has reverted to the 1.1.3 method of preUpdate, so you can now position sprites with x/y, drag them, etc, regardless of the Body.moves flag (issue #606)
ArcadePhysics.World now has setBounds and setBoundsToWorld methods, which are called automatically on world resizing.
ArcadePhysics.Body no longer sets the offset to match the anchor.
2014-03-19 02:28:20 +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
2ecb0c7c76 P2.removeBody will check if the body is part of the world before removing, this avoids a TypeError from the p2 layer. 2014-03-17 22:34:19 +00:00
photonstorm
08aa381238 p2 object re-created on system start. 2014-03-17 21:16:59 +00:00
photonstorm
3ebd0d9303 Updated Device.isConsoleOpen as it no longer works in Chrome. Revised code and documentation accordingly (fix #593)
Revised p2 clear process.
2014-03-17 19:39:56 +00:00
photonstorm
96296c6582 The P2 World wouldn't clear down fully on a State change, now properly clears out contacts, resets the bitmask, etc. 2014-03-17 18:57:46 +00:00
Stefan Holmgren
e3480ffd3c Add destroy methods to Ninja Body, AABB and Circle
The Sprite.destroy() method calls the Body’s destroy() method if a body
exists. If using Ninja physics, destroying a Sprite will not work,
since the destroy method wasn’t implemented in Ninja’s Body.

Also added destroy() methods to Ninja’s AABB and Circle. Tile already
have a destroy() method.
2014-03-16 12:14:46 +01:00
photonstorm
b9ac0d565e Fixed Tile callback check in Arcade Physics (fix #562) 2014-03-16 00:53:50 +00:00
Richard Davey
227810ee01 Merge pull request #571 from dreadhorse/dev
Ninja world collision to check right and bottom bounds
2014-03-16 00:41:51 +00:00
Stefan Holmgren
51102797ed Ninja world collision to check right and bottom bounds
The world collision algorithm need to check the right and bottom of the
bounds in case the bound’s x or y are not equal to 0
2014-03-15 06:19:26 +01:00
Richard Davey
fc5504f8d8 Fixed Sprite.destroy with an arcade body 2014-03-15 01:06:01 +00:00
photonstorm
5e11b1ad87 The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563) 2014-03-14 19:20:35 +00:00
photonstorm
901a7f13d1 Updated docs for 2.0 release and updated README. 2014-03-14 06:36:05 +00:00
photonstorm
44a5741148 Fixed games. Updated Body.moves handling. 2014-03-14 04:49:55 +00:00
photonstorm
0e29bd4300 Tile Collision Callbacks working properly. CSV / Blank map examples added. Multiple tilesets per map working again. That's it folks! 2014-03-14 04:21:56 +00:00
photonstorm
f3ff9c197f Fixed all the tilemap examples. 2014-03-14 03:26:06 +00:00
photonstorm
017a017b96 TilemapLayer.getRayCastTiles will let you get all tiles that hit the given line for further processing.
Fixed Tilemap collision. Added new TILE_BIAS const to aid with fast/small sprites.
2014-03-14 02:33:58 +00:00
photonstorm
a83a76bc5d Line.coordinatesOnLine will return all coordinates on the line using Bresenhams line algorithm. 2014-03-14 00:05:03 +00:00
photonstorm
ec0b22268d Added Body.tilePadding to help with small/fast moving bodies vs. tile collision. 2014-03-13 23:15:32 +00:00
photonstorm
5297497632 Tilemap collision finally getting closer. 2014-03-13 22:49:08 +00:00
photonstorm
e955145707 Added p2 kill and reset test + nearing completion on tilemap collision. 2014-03-13 21:14:18 +00:00
photonstorm
c8e63582a4 Lots of small tweaks to pass jshint. 2014-03-13 16:49:52 +00:00
photonstorm
c2d38fe16b jshint passed all the p2 physics and fixed Debug.spriteBounds. 2014-03-13 16:16:14 +00:00
photonstorm
b666874592 Fixed Body.reset and Tanks game. 2014-03-13 15:57:49 +00:00
photonstorm
dc434dd1ff Render Debug moved into Arcade class. 2014-03-13 15:41:56 +00:00
photonstorm
41bc616a3b preUpdate rotation fix. 2014-03-13 13:29:54 +00:00
photonstorm
181ef7ce53 Added World.frameRate - The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property.
Added World.useElapsedTime - If true the frameRate value will be ignored and instead p2 will step with the value of Game.Time.physicsElapsed, which is a delta time value. #554
2014-03-13 13:19:02 +00:00
photonstorm
c3f687eda9 Prismatic Constraint done. That's all of them! jshint time. 2014-03-13 13:09:33 +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
photonstorm
ef359e8992 P2 Springs example done and working nicely. 2014-03-13 10:32:34 +00:00
photonstorm
aa6b1821bd Get First Dead example. 2014-03-13 10:14:06 +00:00
photonstorm
8318a58f69 Fixed bug causing Text with empty or no given text to break. Added World.createSpring. 2014-03-13 09:43:00 +00:00
photonstorm
0584d3eadf P2 collision groups and callbacks working as expected, new example done. 2014-03-13 09:14:12 +00:00
photonstorm
94448d2497 P2 postBroadphase example and handler done. Group.enableBodyDebug added. Sprites no longer remove bodies from the world if exists = false, instead they set safeDestroy to true, which removes the body on the next preUpdate, to avoid mid-step destruction issues. 2014-03-13 07:29:23 +00:00
photonstorm
84741f065f New P2 examples. And fixed Camera.atLimit value. 2014-03-12 16:33:53 +00:00
photonstorm
fc788f909c P2 Body Begin and End Contact events done and working nicely. 2014-03-12 15:26:20 +00:00
photonstorm
274fd4a7e9 You can now hitTest against P2 bodies + example created. 2014-03-12 13:26:27 +00:00
photonstorm
abf26df741 New P2 examples and fixed Body debug assignment parameter. 2014-03-12 06:25:29 +00:00
photonstorm
a07cf894a0 Fixed Kenny tiles. Fixed Ninja Circle vs. World bounds. Added Ninja tilemap to Tiles conversion. Created test. 2014-03-12 02:44:34 +00:00
photonstorm
4910f27a88 You can now over-ride the pxm and mpx functions with your own via the physics config object. 2014-03-12 00:12:26 +00:00
photonstorm
cb5a8c7515 Renamed px2p and p2px to: pxm and mpx (px to meters and meters to px). Also removed from Math. 2014-03-12 00:07:27 +00:00
photonstorm
e9ae465272 Sorted out Body gravity settings and updated the example. 2014-03-11 16:26:03 +00:00
photonstorm
58887d9bc6 Moved all of the Tilemap to P2 body methods into P2 itself (makes more sense this way) and tidied them up. 2014-03-11 15:02:59 +00:00
photonstorm
d2d77f37dd Finished Ninja Physics updates. 2014-03-11 14:21:20 +00:00
photonstorm
170776ada1 rnd updated so the array picks use length -1 (fixes #541) 2014-03-11 10:56:54 +00:00
photonstorm
384451bef7 Particles back in and working again. Also updated most of the examples and put Body.gravity back in as well. 2014-03-11 02:49:55 +00:00
photonstorm
f321cab77e The physics configuration object can now be used to start physics systems specifically. 2014-03-11 01:23:41 +00:00
photonstorm
a6467f9b60 Fixed Arcade, Ninja and P2 enable methods. Modified core Physics enable. Added world enable test. 2014-03-11 01:11:08 +00:00
photonstorm
53797171a3 Fixed Group.sort. Added z-depth property to all core game objects. Fixed P2 const overwrite. 2014-03-10 23:01:10 +00:00
photonstorm
b4cb281f1c Renamed Phaser.Physics.P2 const to Phaser.Physics.P2JS to avoid issue #540 2014-03-10 22:15:03 +00:00
photonstorm
13ff8985e1 Merged @georgiee p2 BodyDebug and reformatted for jshint pass. Looks awesome :) #536 2014-03-10 15:25:43 +00:00
Richard Davey
751af10c52 Merge pull request #536 from georgiee/debug-draw-p2
Debug draw p2
2014-03-10 14:50:01 +00:00
photonstorm
1fe331956a Added in p2.total 2014-03-10 14:47:29 +00:00
photonstorm
9f997daa46 Lots of examples fixes and put Group.sort back in. 2014-03-10 14:33:18 +00:00
Georgios Kaleadis
569770ed21 update 2014-03-10 14:28:44 +01:00
Georgios Kaleadis
95e2081f3a more p2 fixes 2014-03-10 13:17:37 +01:00
Georgios Kaleadis
c611d51751 minimal runable new p2 integration 2014-03-10 13:15:05 +01: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
c4183d200f Changed the define function calls to use named modules, allows pixi, phaser and p2 to reside in 1 file and still be located by requirejs (thanks brejep, #531) 2014-03-10 01:39:36 +00:00
photonstorm
45ab4673cc ScaleManager.fullScreenTarget allows you to change the DOM element that the fullscreen API is called on (feature request #526) 2014-03-10 01:13:01 +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
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
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
Richard Davey
3794a846d4 Merge pull request #504 from georgiee/fix-single-polygon
Phaser.Physics.Body#loadPolygon
2014-03-02 11:26:31 +00:00
photonstorm
66bdf56349 The physics world is now cleared on state swap (fixes #505) 2014-03-02 11:04:04 +00:00
Georgios Kaleadis
a1bb3ea23b pop first element if there is only one shape 2014-03-01 12:04:30 +01:00
photonstorm
4562939e4e Fixed stupid error in destroy(). 2014-02-28 06:17:18 +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
a6d77d00a0 World gravity restored. 2014-02-23 11:42:24 +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
7ee0c20bb3 Added Debug.renderSpriteBounds() back and wrapped Body.velocity and force in px2p calls. 2014-02-21 15:34:15 +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
1762983bc0 Fixed loadPolygon reference. Need to test decomp data next. 2014-02-19 17:09:01 +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
7394403bb6 Fresh build. Updated docs and re-built phaser.js. 2014-02-19 05:28:19 +00:00