Search the Community

Showing results for tags 'p2'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 332 results

  1. AlexArroyoDuque

    help - arcade physics with p2 objects

    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?
  2. 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!
  3. right now THIS is my approach: global: var platformvelocity1=100;create: movingplatformvertical = game.add.sprite(150, game.world.height - 300, 'paddle'); game.physics.p2.enable(movingplatformvertical);movingplatformvertical.body.setCollisionGroup(groundCG);movingplatformvertical.body.collides(playerCG);movingplatformvertical.body.mass=9999;movingplatformvertical.body.data.gravityScale=0;movingplatformvertical.body.data.motionState =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: http://test.xapient.net/phaser/ALL/ 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 !!
  4. 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?
  5. 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: this.game.physics.overlap( plane.blip, this.blips, function( blip1, blip2 ) { this.onCrash();}, function( blip1, blip2 ) { return blip1.group.alive && blip2.group.alive;}, 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!
  6. 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
  7. valueerror

    Which Physics System To Chose ?

    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!