help with collision #139
-
Hi annoraaq, First of all, this is brilliant work and you have been very kind to provide comprehensive documentation alongside. I've spent a good few hours this weekend going through everything and checking out some examples, but I am afraid to say I haven't been able to nail down the collision system. I am just starting my coding journey so I appreciate this may be a very silly question, but would you be able to pinpoint in the sandbox below where it is that I am missing something? I have quite a few things commented out where I've explore some options, but my player will still only collide with the npc. I can also see that both sprites are on the top layer, above everything else, so that could explain the issues; however, I've been unable to hardcode the layering through any of the methods that I've found online. My idea is to build a small game to help language learners learn Welsh, and your plugin has been a massive help towards that goal. This is the sandbox with my experimentations: https://codesandbox.io/s/hungry-sun-ykb6f?file=/src/index.js Thank you again! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Fernando, I am happy to hear you like the plugin. I think I found your issue. You are using
I think the documentation might be a bit confusing about this because
Let me know if this helps. And thank you for pointing out a weakness in the docs! |
Beta Was this translation helpful? Give feedback.
Hi Fernando,
I am happy to hear you like the plugin.
I think I found your issue. You are using
collides
as a tile property but you are not setting this in the configuration. It used to work with versions < 2.0.0 of GridEngine. But since version 2,ge_collide
is the default name for the collision property. You now have 2 ways to solve your problem:You use Tiled and change the name of the collision property from
collides
toge_collide
in all your tilemaps.You add
collisionTilePropertyName: 'collides'
to your GridEngine config: https://annoraaq.github.io/grid-engine/api/config.htmlI think the documentation might be a bit confusing about this because
the screenshot here is out of d…