Search the Community

Showing results for tags 'P2'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 335 results

  1. Hello! Since I've migrated to Phaser 2.0.0, the game has a very poor performance. I use the system P2. Is it normal?
  2. the problem can be seen here (as always ;-) ) 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: 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<; i++){ var c =[i]; if( === || ==={ var d =,yAxis); // Normal dot Y-axis if( === 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
  3. Hello. I want to use the physic arcade with objects that have physic p2. I get an error console. Uncaught TypeError: Can not call method 'setTo' of undefined Any help with that?
  4. Hey guys! I'm just starting out with Phaser game programming. I'm trying to build a proof of concept rope system. I for some reason, when I apply gravity, the revolute joint fails. Not sure what to do. Any ideas? Also, I'm running off the dev branch. You can find my demo here: Thanks! preload: function() { game.load.image('rope_piece', 'assets/rope_piece.png'); }, create: function() { cursors = game.input.keyboard.createCursorKeys(); game.physics.startSystem(Phaser.Physics.P2JS); rope_1 = game.add.sprite(100,100,'rope_piece'); rope_2 = game.add.sprite(100,110,'rope_piece'); game.physics.p2.enable([rope_1]); game.physics.p2.enable([rope_2]); //game.physics.p2.enable([rope_3]); game.physics.p2.gravity.y = 100; //rope_1.body.clearCollision(true, true); //rope_2.body.clearCollision(true, true); //rope_1.body.mass = 0; = 2; // = 1; constraint = game.physics.p2.createRevoluteConstraint(rope_1, [0,-5], rope_2, [0,5]); }, update: function() { if (cursors.up.isDown) { rope_2.body.thrust(50); } else if (cursors.right.isDown) { rope_2.body.rotateRight(5); } //rope_1.body.setZeroVelocity(); },
  5. Hi game developers! The player of my game uses P2 physics. I need that when an enemy dies and drop coins the player can catch them. Therefore, the player must be able to collide with the coins.
  6. I saw the example labeled when particles collide, but it didn't have what I wanted. Let's say that in a game there is a ship and an asteroid. How would I make it so that when the ship hits the asteroid, particles emit from the point of contact, so in this case sparks? Is there a way to check point of contact? And if so, would it need to be in a callback, so when the bodies hit create an emitter? Thanks for any help!
  7. ...when one of those buttons is the keyboard cursor RIGHT. here is an example to test it: try to hold down M and SPACEBAR and then move to the right RIGHTCURSOR.. it simply does not work BUT try moving to the left.. it works !! ?? i've testet it in 1.1.5 and in 2.0 - the same problem it comes down to the simple statement that you can not use cursors.right with more than 1 other button together...
  8. jump right into the first whole (and die) 5 times and suddenly you will fall through the tielmap... no idea what causes it... i will try to setup an easier test environment for this with less code and report here if i find something
  9. until the 2 days ago player.body.createGroupCallback(enemyCG, playerDie, this);worked .. also all other forms of collision callbacks worked (body callback, collides, etc) the bodies collide but the callback is never fired.. didn't change a thing.. just phaser 1.2 to 2.0 i read the docs and it seems i've done everything right
  10. so i checked the latest commits and saw that there are now 3 physics systems available and 2 more to come.. wow.. i'm a little bit overwhelmed because i just learned phaser1.1.x and it seemed so easy to understand.. now i'm unsure what to do... therefore i have some questions: 1) if i want to make a typical platformer game with slanted, round, triangle or square tiles i guess i would use ninja for the physics between my objects and the tilemap - wrong? 2) if i also love the possibilities of p2 materials and i want to apply specific material options to one of my gameworld layers? am i able to do so? combine p2 materials with a ninja tilemap collision handler? 2.2) how do i apply something to a layer.. do i really have to circle through every single tile in the tilemap somehow or can't i just say.. layer.setMaterial() ? (i hope there is/willbe a function for that) 3) if i also want very specific collisionProcessHandler (jump through from below but land on platforms for example) can i do this with ninja or do i need to apply arcade physics to this tilemap layer then? 4) if i want to shoot my enemies and need a very simple arcade collisionCallback and also a specific collisionProcesshandler (if invisible do not collide but fly through) AND i want this enemy to collide with my tilemap tiles in a ninja way.. would this be possible? so all in all one question could sum it up: 5) am i supposed to chose A single physics system or are they interoperable ? 6) which physics systems are a good idea to use together and which ones are a very bad idea? 7) is sounds like a performance drop is inevitable when using p2 and ninja and arcade alltogehther -wrong? big thx for every answer!