Jump to content

Search the Community

Showing results for tags 'p2 phaser'.

  • 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 1 result

  1. I got a problem that the P2 collision mesh is not properly aligned with the bitmap. Here's the sprite's bitmap: I measured the pixel coordinates on the bitmap and got this mesh: { "ship": [ { "density": 2, "friction": 0, "bounce": 0, "shape": [ 16, 31, 0, 29, 16, 0, 31, 29 ] } ] } And the CoffeeScript code: @ship = game.add.sprite(200, 200, 'ship') game.physics.p2.enable(@ship, true) @ship.body.clearShapes() @ship.body.loadPolygon('physicsData', 'ship') But as you can see in the image, the physics debug polygon (purple) is not properly aligned with the bitmap. My theory is that the bitmap is automatically centered on the physics polygon, because no matter how I tweak the values in the physics mesh, it won't align with the bitmap. For example, if I add 50 to all x coordinates in the polygon, the sprite will appear 50 pixels to the right, but the polygon will still be drawn on top of the sprite, not beside it. Is there a way to disable this?
×
×
  • Create New...