rich Posted March 19, 2014 Share Posted March 19, 2014 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. clark and Teemu-Tor 2 Link to comment Share on other sites More sharing options...
onefatman Posted March 19, 2014 Share Posted March 19, 2014 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 settingthe game.physics.arcade.collide function is brokenSeems 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 More sharing options...
Arlefreak Posted March 19, 2014 Share Posted March 19, 2014 Those the Arcade Physics have Rotation again ? Link to comment Share on other sites More sharing options...
rich Posted March 19, 2014 Author Share Posted March 19, 2014 Yes, but then I never removed that anyway! But the angular velocity / acceleration demos all work fine, as do other tests with rotation. Link to comment Share on other sites More sharing options...
nunorfpt Posted March 19, 2014 Share Posted March 19, 2014 in 2.0 I had two arcade physics sprites not firing either the collision handler or the overlap handlerwith 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 More sharing options...
cub Posted March 19, 2014 Share Posted March 19, 2014 I confirm that the new regexp works* Fixed the IE11 version check (fixes #579) Link to comment Share on other sites More sharing options...
rich Posted March 19, 2014 Author Share Posted March 19, 2014 in 2.0 I had two arcade physics sprites not firing either the collision handler or the overlap handlerwith 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 More sharing options...
rich Posted March 19, 2014 Author Share Posted March 19, 2014 Actually scratch that comment (aside from the callbacks part), I'm trying something now which blends somewhere in the middle. Link to comment Share on other sites More sharing options...
rich Posted March 20, 2014 Author Share Posted March 20, 2014 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 More sharing options...
Yora Posted March 20, 2014 Share Posted March 20, 2014 This fixed all of the problems I was having with the 2.0 arcade physics, everything working as intended for my code at least. Link to comment Share on other sites More sharing options...
MichaelD Posted March 20, 2014 Share Posted March 20, 2014 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. http://www.netgfx.com/trunk/games/Nevermore/ Testing with chrome 33 Flexicon 1 Link to comment Share on other sites More sharing options...
Videlais Posted March 20, 2014 Share Posted March 20, 2014 @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 More sharing options...
rich Posted March 20, 2014 Author Share Posted March 20, 2014 I've not touched anything re: loading, it's been pretty much mostly physics updates in 2.0.1, but yes shed-loads changed in 2.0.0, across most areas (the biggest being updating Pixi and resulting changes). Link to comment Share on other sites More sharing options...
r00 Posted March 20, 2014 Share Posted March 20, 2014 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 More sharing options...
Videlais Posted March 20, 2014 Share Posted March 20, 2014 @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 More sharing options...
Flexicon Posted March 21, 2014 Share Posted March 21, 2014 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. 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 More sharing options...
rich Posted March 21, 2014 Author Share Posted March 21, 2014 Don't worry this is fixed in dev (as of about an hour ago). MichaelD 1 Link to comment Share on other sites More sharing options...
nunorfpt Posted March 22, 2014 Share Posted March 22, 2014 just pulled the new dev build, and it fixed all problems i had , including the speed-up side effect.thank you rich Link to comment Share on other sites More sharing options...
rich Posted March 22, 2014 Author Share Posted March 22, 2014 Nice. I'm working through some tilemap things at the moment and then will be ready with this release. Link to comment Share on other sites More sharing options...
Play's Zone Posted March 22, 2014 Share Posted March 22, 2014 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 More sharing options...
Play's Zone Posted March 22, 2014 Share Posted March 22, 2014 "game.physics.enable(g.terrain, Phaser.Physics.ARCADE);" now will reset the y position to 0 after the first update method is called in game. update : function(){ console.log(g.terrain.body.y) Will output: 600, 0, 0, 0, 0, 0.... Link to comment Share on other sites More sharing options...
Play's Zone Posted March 22, 2014 Share Posted March 22, 2014 Also in the console when the phaser game starts there are no hearts, but some strange characters. Link to comment Share on other sites More sharing options...
hbk619 Posted March 22, 2014 Share Posted March 22, 2014 I was having the same issues as this guy http://www.html5gamedevs.com/topic/4929-20-arcaded-tile-collision-issue/ but this build fixed it cheers! Link to comment Share on other sites More sharing options...
AlexArroyoDuque Posted March 22, 2014 Share Posted March 22, 2014 If I use this version my game does not run.Error in PhaserJSgame is not defined Link to comment Share on other sites More sharing options...
Fishrock123 Posted March 23, 2014 Share Posted March 23, 2014 Has fixed issues for numerous people in IRC so far, no bugs reported.* Fixed Grunt script that stopped the P2 constraint classes from building properly.That in particular also affected myself, glad it's fixed! Link to comment Share on other sites More sharing options...
Recommended Posts