Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by StuartTresadern

Hi,

I have just started with the impact engine and the physics example currently the example only creates the box2D collision map using full tiles it does not detect the new slopes when the box2d collision polygons are created. How do I detect what type of collision tile is used in the collision map data ?.

To start with i want to extend the sample to create polygons that include the slopes and then maybe look at adding to the level editor later so that i can create custom collision polygons by defining sets or group points rather than automatically building the collision geometry based on the tiles.

1 decade ago by Arantor

The demo is built against an older version of Impact. Start by adding the demo files to Impact 1.19 which should stand a better chance of handling entity vs world collisions... But I think you're the first to try it.

1 decade ago by StuartTresadern

I have it working with 1.19 but i could not work out how to detect which collision tile type was being used when converting the collision map to Box2D polygons. Currently I can only see full (which covers all tiles that have some kind of collision tile) and empty tiles.

Once I get it working this way I want to create a better way to map the Box2D collision polygons to the collision tile map.

1 decade ago by StuartTresadern

Worked it out thanks, just need to locate the code that maps the different slopes etc used in the map and then the map array hold all the new values. A little math and i should be able to create some polys to cover the different slop tiles.

1 decade ago by Arantor

That's in collision-map.js, where it maps the tiles to set values. The tilemap used is 11x5, starting at 1 (0 is empty)

1 decade ago by StuartTresadern

Thanks for your help. This is what I finally came up with.

http://impactjs.com/forums/code/box2d-collision-polygons-for-new-slope-tiles

A little rough but it works. Next stage is to extend impact and the editor to allow custom collision polygons to be created.
Page 1 of 1
« first « previous next › last »