Jump to content

Phaser 2.0.1 Ready for Testing


rich
 Share

Recommended Posts

Hi all,

 

Could anyone who's been having issues with 2.0, especially with ArcadePhysics, please test out the new 2.0.1 build which is currently in the dev branch: https://github.com/photonstorm/phaser/tree/dev/build

 

I have pushed ArcadePhysics back again, so it now much more accurately copies how 1.1.3 worked, which means things like positioning the body, dragging sprites, etc should all be fine again. Also I have fixed every single Arcade Physics example in the examples repo (also uploaded to the site), and they all now work as expected. Also fixed a couple of the games.

 

Here is a complete list of what's in this release:

 

Bug Fixes

 

* The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563)
* Sprite.destroy would fail if it had an Arcade Physics body, now added.
* Group.getAt comparison updated (fixes #578)
* Fixed the IE11 version check (fixes #579)
* Ninja world collision to check right and bottom bounds (thanks dreadhorse, fix #571)
* Group enableBody parameter was incorrectly assigned to the debug var (thanks BurnedToast, fix #565)
* Fixed Tile callback check in Arcade Physics (fix #562)
* Removed the examples build script from the Gruntfile (fix #592)
* The P2 World wouldn't clear down fully on a State change, now properly clears out contacts, resets the bitmask, etc.
* Button.onInputUpHandler wouldn't set an upFrame for a frame ID of zero, made the check more strict.
* Fixed the Loader.preloadSprite crop effect on WebGL.
* Fixed Grunt script that stopped the P2 constraint classes from building properly.
* 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)
* 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.
* Debug.spriteBounds will now take the position of the camera into consideration when rendering the bounds (fix #603)
* InputHandler.dragFromCenter will now work regardless of the anchor point of the Sprite (fix #600)

 

Updated:

 

* Updated Device.isConsoleOpen as it no longer works in Chrome. Revised code and documentation accordingly (fix #593)
* Removed State.destroy empty method and replaced with State.shutdown, as that is what the StateManager expects (fix #586)
* P2.removeBody will check if the body is part of the world before removing, this avoids a TypeError from the p2 layer.
* 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.
* Swapped the order of the _pollGamepads gamepads check, to stop the Chrome 'webkitGamepads is deprecated' error in the console.
* Lots of TypeScript definitions updates (thanks as always to clark for these)
* Removed Device.patchAndroidClearRectBug as it's no longer used internally.
* Math.wrapAngle now supports radians (thanks Cryszon, #597)
* Group.replace will now return the old child, the one that was replaced in the Group.
* 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.
* 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.

 

New Features:

 

* Device.getUserMedia boolean added, useful if you need access to the webcam or microphone.
* Math.removeRandom allows you to remove (and return) a random object from an array.
* ArcadePhysics.World now has a checkCollision object which can be used to toggle collision against the 4 walls of its bounds.
* Sprite.events.onEnterBounds added. This is dispatched if the Sprite leaves the bounds but then returns. The opposite of onOutOfBounds.

Link to comment
Share on other sites

I've copied the Map Collide (mario) example as accurately as possible using tiled for level creation and i'm having real issues trying to get my hero sprite to collide with ANY of the tiles - is there some "collision" setting in Tiled I'm meant to be using?

 

http://bit.ly/1l2qfSP is my test game so far, it seems to me that either:

 

  • there's some "this is the collision layer" setting either in Tiled or Phaser that I'm meant to be setting
  • the game.physics.arcade.collide function is broken

Seems to work for the demo though so not sure what's going on and because the 2.0 update is so new there's nothing on line to help me . . . 

Link to comment
Share on other sites

in 2.0 I had two arcade physics sprites not firing either the collision handler or the overlap handler

with this update, the overlap handler gets fired but not the collide handler

 

both sprites are in an horizontal tilemap, created with Tiled, and found no collision problems with the player sprite movement but between version 2.01 and 2.0 the same added values for player.body.gravity.y and player.body.x have different behaviours. On 2.01 the player goes faster in the screen than on 2.0 if I use the same values for each version

Link to comment
Share on other sites

in 2.0 I had two arcade physics sprites not firing either the collision handler or the overlap handler

with this update, the overlap handler gets fired but not the collide handler

 

both sprites are in an horizontal tilemap, created with Tiled, and found no collision problems with the player sprite movement but between version 2.01 and 2.0 the same added values for player.body.gravity.y and player.body.x have different behaviours. On 2.01 the player goes faster in the screen than on 2.0 if I use the same values for each version

 

Hmm, all the Arcade Physics tests/examples are passing (which include collision, overlap and process handlers), so I'd need to see if something else is going on here really.

 

The object speed-up is a side-effect of moving to the earlier implementation of AP I'm afraid. The way velocity was calculated (and integrated) in 2.0 is significantly better than in 2.0.1 imho! But sadly too different from earlier versions, so the aim was to literally go back to exactly how it was done before, flaws and all.

Link to comment
Share on other sites

Ok I just pushed a brand new build - please give that a shot. I think this is about as close as I can get it to how I want it to behave. The 'increased speed' thing should be gone, the tilemap jitters are gone too and the Body now scales with the sprite automatically. It's a sort of mid-point between 2.0 and 1.1.3! but I think realistically it has to remain how it is in this build (blatant bugs withstanding).

Link to comment
Share on other sites

@rich: Has anything been changed with regard to loading or handling images in 2.0 or 2.0.1?

 

I'm getting reports of images disappearing in CocoonJS in Accelerated mode with Phaser.CANVAS.

 

The current fix, which I'm trying to figure out, is to add an extra "game.add.image(0,0,'')" to the code.

 

For example, to make the Diamond Burst emitter example work with Phaser 2.0.1, that extra "var fake..." line needs to be added.

var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', {preload: preload, create: create});var p; function preload() {     game.load.image('diamond', 'diamond.png'); } function create() {     game.stage.backgroundColor = '#337799';     p = game.add.emitter(game.world.centerX, 200, 200);    p.makeParticles('diamond'); p.start(false, 5000, 20);    var fake = game.add.image(0, 0, ''); }
Link to comment
Share on other sites

I was about to report an issue with IE crashing on state change in 2.0.0+, possibly due to use of TypedArray, but it seems to have been fixed in github.com/photonstorm/phaser/issues/590.

 

It's weird, as IE11 should have support for TypedArrays, at least according to caniuse.com/typedarrays. Same should apply to windows phone, but both were apparently crashing due to it.

 

With today's version 2.0.1, the game doesn't crash anymore (ie and wp both work), but it still throws error saying Float32Array is undefined on line 57257, when using arcade physics in IE.

Link to comment
Share on other sites

@rich: Hmm. Well, it looks like images might be broken in CocoonJS for some reason.

 

The following code doesn't display anything.

var game = new Phaser.Game(800, 600, Phaser.CANVAS, '',              {preload: preload, create: create});function preload() {   game.load.image('diamond', 'diamond.png');}function create() {   game.add.image(150, 150, 'diamond');}

It's not strictly something to do with 2.0.1, I know, but I hadn't moved over to testing Phaser 2.0 proper yet. (The 1.2 'dev' branch was, about a week ago, working fine for me in CocoonJS though.)

 

I'm looking into it today.

Link to comment
Share on other sites

Been having some problems with 2.0.1, where all the tileSprites go to the top of the game container. Even the examples that I downloaded when run from localhost seem to have that problem. Here is a screen and a game to show this.

 

Untitled-2_zps0c4f26f7.jpg

 

http://www.netgfx.com/trunk/games/Nevermore/

 

Testing with chrome 33

 

Same issue, any ideas on why or how to fix this?

Link to comment
Share on other sites

Hello another problem in the emitter:

 

 
            emitter = game.add.emitter(0, 0, 200);
            emitter.makeParticles('particle');
 
Will throw an error "game not found"
 
Faulty code: "game.physics.arcade.enable(particle, false);", line 47239, in method "Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames, quantity, collide, collideWorldBounds)", version 2.0.1 dev branch today. Should be "this.game....". 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...