Jump to content

Search the Community

Showing results for tags 'setpostbroadphasecallback'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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 2 results

  1. Hello, I was using Arcade physics and the collisions were working perfectly fine when defined as physics.arcade.collide. In my game, I have an AI character moving in a straight line, flipping direction when colliding with walls. Walls are defined in a layer, with a custom property 'collision' set to true. (defined in Tiled). I had to switch to P2 physics as I needed more sophisticated collisions for some objects that had polygon shapes, and also had to use something that P2.Spring defines. With P2, when my AI collides with the walls it bounces back in XY direction - while the ideal behaviour is that with - this.body.velocity.x *= -1; OR this.body.velocity.y *= -1; - It should only remain on its axis. I thought I would solve it by checking collision bodies in setPostBroadphaseCallback but that does not seem to work as desired or may be I am missing something very obvious. if(body1 != null && body1.sprite != null && body1.sprite.key === 'enemy'){ // I would want to check body2 as I do body1 but for my tile body2.sprite is NULL. } I even tried comparing with each wall body gotten from the below method - this.walls = this.game.physics.p2.convertTilemap(this.map, this.layers[layer.name]); The walls collision is defined as below - for(var i=0; i<this.walls.length; i++){ this.walls.setCollisionGroup(this.collision_groups["wallCG"]); this.walls.collides(this.collision_groups["playerCG"]); this.walls.collides(this.collision_groups["enemyCG"]); } Is there a way that I would know the collision group of body2? OR compare collision groups and not body1 and body2 in setPostBroadphaseCallback? Please help. It's urgent. Thanks in advance! agogiam
  2. Video of issue: https://www.dropbox.com/s/td88t29bxq7jwqk/Phaser-wrong-overlaping.mov?dl=0 Background should change when zone and gift are overlapped but setPostBroadphaseCallback fire event on wrong time. I think It happens maybe because zone looks like a rectangle... This is code for the video you see above: http://paste.ofcode.org/QE7KjbDy4bXLLYNQDKDDnY
×
×
  • Create New...