valueerror Posted March 16, 2014 Share Posted March 16, 2014 the problem can be seen here (as always ;-) ) http://test.xapient.net/phaser/ALL/ i apply a frictionless material so it doesn't stick to the wall... this works most of the time..but if you push the button to move into the direction of the wall in the air again.. it will eventually stick to the wall .. (it does that even if i set every contactmaterial to friction=0 )i think it shouldn't because there is no friction at all.. this is maybe related to another post right here: http://www.html5gamedevs.com/topic/4807-physics-bodies-stick-when-colliding-from-the-side/ i am trying to get something like the arcade "touchingDown" with this function (thx to rich's lab experiment) function touchingDown(player){ var yAxis = p2.vec2.fromValues(0,1); var result = false; for(var i=0; i<game.physics.p2.world.narrowphase.contactEquations.length; i++){ var c = game.physics.p2.world.narrowphase.contactEquations[i]; if(c.bi === player.body.data || c.bj === player.body.data){ var d = p2.vec2.dot(c.ni,yAxis); // Normal dot Y-axis if(c.bi === player.body.data) d *= -1; if(d > 0.4) result = true; } } return result;}and it showed me that (if you change (d>0.4) to (d>0) ) touchingDown is always true when the player sticks .. i honestly think that this is something to be solved at the "phaser side" - at least i did't find a 'cure' yet Link to comment Share on other sites More sharing options...
valueerror Posted March 21, 2014 Author Share Posted March 21, 2014 here is a better testcase.. ice VS ground, walls to stick on http://localhost/PHASER/ALL/sticktowall.html Link to comment Share on other sites More sharing options...
Recommended Posts