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
  • 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. 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
  2. In version 1.1.6 it was possible to use overlap in collisions. There is something similar in the physics system p2? Now I use to define collision the "collides" function: collides (group, callback, callbackContext, shape) The problem is that the player can walk over enemies for example.
  3. 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
  4. 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?
  5. 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!
  6. right now THIS is my approach: global: var platformvelocity1=100;create: movingplatformvertical = game.add.sprite(150, - 300, 'paddle'); game.physics.p2.enable(movingplatformvertical);movingplatformvertical.body.setCollisionGroup(groundCG);movingplatformvertical.body.collides(playerCG);movingplatformvertical.body.mass=9999;; =1;movingplatformvertical.body.fixedRotation=true;that means.. create plattform, activate physics, setup collisons, make it waay heavier than the player so the player mass wont affect it, make it immune to gravity, set it to dynamic, disable rotation and then in the update loop: if(movingplatformvertical.body.y > 800){ platformvelocity1*=-1;}else if (movingplatformvertical.body.y < 600){platformvelocity1*=-1;}movingplatformvertical.body.velocity.y =platformvelocity1;movingplatformvertical.body.x = 150; //make x staticyou may test it here: this looks very improvised and i can not get rid of the feeling that there is a MUCH better, easier way for this - so if you have some insight - please feed me your information.. thank you all very much !!
  7. Hello! I am the P2 physics. I have a sprite scaled. My problem is that the polygon loaded to the sprite does not scale with it. It is possible to scale the polygon?
  8. Hi, I've just started porting a bunch of games from version 1.1.6 and I'm struggling to work out how to get the same effects using P2 that were pretty straight forward with the Arcade physics engine. Because setCircle() has been removed from the Arcade engine I need to use P2 to make sure my collisions are correct. Here's a snippet from my update loop previously where I was checking if a radar 'blip' overlapped any of the other blips in the this.blips array: plane.blip, this.blips, function( blip1, blip2 ) { this.onCrash();}, function( blip1, blip2 ) { return &&;}, this ); So I'm looking at using body.onBeginContact.add() but that seems to cause the sprites to start interacting with each other which I don't want. Any suggestion on how to recreate the above? The physics.overlap method before was so simple!
  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!