Commit graph

1324 commits

Author SHA1 Message Date
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
Richard Davey
aefa89b556 Merge pull request #609 from georgiee/fix-p2-body
Fixed (still) wrong constants in Phaser.Physics.P2.Body
2014-03-19 23:03:54 +00:00
Georgios Kaleadis
5b78c5c46e fixed wrong motion state constants in phaser p2 body 2014-03-19 22:56:26 +01: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
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
4bfbd4dc96 2.0.1-19 build files. 2014-03-19 12:12:59 +00:00
photonstorm
96365a3a1f The StateManager is now responsible for clearing down input, timers, tweens, physics, camera and the World display list.
Removed the use of Int16Array from all Game Objects, swapped for standard Array. Phaser now runs on Android 2.x again (fix #590)
2014-03-19 12:05:19 +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
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
9959e21925 Debug.spriteBounds will now take the position of the camera into consideration when rendering the bounds (fix #603) 2014-03-19 02:31:37 +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
df4debf2a6 Build update for testing. 2014-03-19 00:57:10 +00:00
photonstorm
11fdd62436 World.destroy incorrectly clashed with the Group.destroy method it over-rode, renamed to World.shutdown and updated StateManager accordingly.
World.shutdown now removes all children iteratively, calling destroy on each one, ultimately performing a soft reset of the World.
Objects with a scale.x or y of 0 are no longer considered valid for input (fix #602)
InputHandler will set the browser pointer back to default if destroyed while over (fix #602)
Group.destroy has a new parameter: `soft`. A soft destruction won't remove the Group from its parent or null game references. Default is `false`.
InputHandler.validForInput is a new method that checks if the handler and its owner should be considered for Pointer input handling or not.
Group.replace will now return the old child, the one that was replaced in the Group.
2014-03-19 00:54:49 +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
870d534e50 Fixed the Loader.preloadSprite crop effect on WebGL. 2014-03-18 16:23:44 +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
Richard Davey
511b2f017a Merge pull request #597 from Cryszon/patch-1
Added support for radians in wrapAngle
2014-03-18 15:13:32 +00:00
Kimmo Salmela
97a838edbb Added support for radians in wrapAngle
My first time proposing a change in GitHub, so I hope I did it correctly.
2014-03-18 13:40:07 +02:00
photonstorm
928b883c17 Swapped the order of the _pollGamepads gamepads check, to stop the Chrome 'webkitGamepads is deprecated' error in the console. 2014-03-18 00:10:43 +00:00
photonstorm
89cdaef84d New build files. 2014-03-18 00:01:39 +00:00
photonstorm
4a407f12a1 Button.onInputUpHandler wouldn't set an upFrame for a frame ID of zero, made the check more strict. 2014-03-17 23:57:27 +00:00
photonstorm
46d5069110 Tilemap.createFromObjects has a new parameter: adjustY, which is true by default. Because Tiled uses a bottom-left coordinate system Phaser used to set the Sprite anchor to 0,1 to compensate. If adjustY is true it now reduces the y value by the object height instead. 2014-03-17 23:54:04 +00:00
photonstorm
90ef694347 Tilemap.createFromObjects used to set the Sprite anchor to 0,1 because Tiled uses a bottom-left coordinate system. It now calculates the offset in TilemapParser. 2014-03-17 23:27:13 +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
f32dce8cdd New build files. 2014-03-17 21:18:02 +00:00
photonstorm
08aa381238 p2 object re-created on system start. 2014-03-17 21:16:59 +00:00
photonstorm
a8502f3498 Removed State.destroy empty method and replaced with State.shutdown, as that is what the StateManager expects (fix #586) 2014-03-17 19:43:28 +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
Richard Davey
67919af33c Merge pull request #591 from clark-stevenson/patch-1
Basic p2 added
2014-03-17 16:12:12 +00:00
photonstorm
bc8b2424ce Removed the examples build script from the Gruntfile (fix #592) 2014-03-17 16:10:19 +00:00
photonstorm
30a04985f7 Working through blank tilemap fix. 2014-03-17 16:10:19 +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
Richard Davey
ccffcbdc9a Merge pull request #584 from clark-stevenson/patch-2
Ninja Physics Added
2014-03-17 10:30:36 +00:00
clark-stevenson
1152fe6ee2 Ninja Physics Added 2014-03-16 15:21:22 +00:00
Richard Davey
e8b08cbdcc Merge pull request #581 from dreadhorse/destroy
Add destroy methods to Ninja Body, AABB and Circle
2014-03-16 12:42:41 +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
photonstorm
ec2275e18c Group enableBody parameter was incorrectly assigned to the debug var (thanks BurnedToast, fix #565) 2014-03-16 00:45:47 +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
photonstorm
db88bd2f22 Fixed the IE11 version check (fixes #579) 2014-03-16 00:39:42 +00:00
photonstorm
fee4d36b91 Group.getAt comparison updated (fixes #578) 2014-03-15 23:53:05 +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