frankdev Posted June 28, 2014 Share Posted June 28, 2014 Hello all, I think the title pretty much sums up what I want to ask. Is it possible to have sprites that don't collide as if they were rectangles, but rather as the shape they actually are. I am fairly certain that this cannot be achieved as easily as I hope and I wonder if it is possible at all. Thanks Link to comment Share on other sites More sharing options...
wayfinder Posted June 28, 2014 Share Posted June 28, 2014 You'll need P2 physics, but it's a basic functionality there. Link to comment Share on other sites More sharing options...
titmael Posted June 28, 2014 Share Posted June 28, 2014 Yes you need to use P2 physics. You can use https://www.codeandweb.com/physicseditor to draw shapes and export in a json file. You have an exemple to import the json file to a sprite : http://examples.phaser.io/_site/view_full.html?d=p2%20physics&f=load+polygon+1.js&t=load%20polygon%201 mtburdon 1 Link to comment Share on other sites More sharing options...
frankdev Posted June 28, 2014 Author Share Posted June 28, 2014 Wow thanks! Any way to do this with tile maps? Link to comment Share on other sites More sharing options...
lewster32 Posted June 28, 2014 Share Posted June 28, 2014 Ninja supports shaped tiles (from a selection of specific shapes) but no, standard Tilemaps have hard-coded square collision. Link to comment Share on other sites More sharing options...
titmael Posted July 1, 2014 Share Posted July 1, 2014 Tilemaps look like a big array of sprites, so you can maybe parse a json tilemap and add each tile yourself, so you can use custom shapes (didn't try it) mtburdon 1 Link to comment Share on other sites More sharing options...
Recommended Posts