hexus / phaser-arcade-slopes

:triangular_ruler: A Phaser CE plugin that brings sloped tile collision handling to the Arcade Physics engine
MIT License
126 stars 16 forks source link

Bodies not colliding #43

Closed dave-kennedy closed 7 years ago

dave-kennedy commented 7 years ago

I'm not sure what I did wrong here, but my player sprite falls straight through the floor. When I enable debugging, it appears the bodies are only being created for some tiles and not others.

screen shot 2017-05-26 at 16 45 48-fullpage

I've uploaded the code to https://github.com/dave-kennedy/Platformer.

hexus commented 7 years ago

Thanks for submitting an issue!

I'm able to replicate this too, without setting the colliding tile index range on the Phaser.Tilemap object.

This should either be mentioned in the readme or silently handled in the plugin somehow, if possible.

image

For now, placing this line of code:

this.map.setCollisionBetween(513, 551, true, 'Tile Layer 2');

Before this line in your fourth level state:

https://github.com/dave-kennedy/Platformer/blob/cfa7dbdf2f8a7274b02a897f25cf2adf8d5754c2/src/State/Level4.js#L46

Should hopefully fix your issue.

If not, I may be using the wrong numbers!

dave-kennedy commented 7 years ago

That did the trick. Thanks!