deepnight / ldtk

Modern, lightweight and efficient 2D level editor
https://ldtk.io
MIT License
3.38k stars 187 forks source link

Collision manager like Tiled's #844

Open imnotdream opened 1 year ago

imnotdream commented 1 year ago

I love it, works PERFECT!!! Except one thing...

You need to add tile collisions. Like the ones in Tiled, where you can select certain tiles, give then a tag, draw a custom hitbox(if the default square wont cut it), and export into the game platform, where it will detect and use the collisions. Here is the gdevelop forum on this, in case you want proof people need this

Cammin commented 1 year ago

The one important point of topic though is the fact that(assuming that poly shapes would be defined in the tileset definition) multiple tiles of tileset art can exist in the same position via auto layers.

I'm wondering if the colliders should be merged in that situation?

Or should collision only be possible for intgrid values?

Cammin commented 1 year ago

There is lots of merit in having collision defined inside the tileset definition though. For example, imagine having to make an intgrid value for every single collision shape. It could get out of hand.

What it hink would be an awesome idea, (and I think deepnight has this idea too) is to introduce a new poly shapes layer type.

With this new layer type, I could imagine we might be able to define shapes. And we could either: -Paint the shapes ourselves Or, -setup rules to place shapes based on auto rules of the int grid values Or, -just place nodes/lines in the level that comprise of a poly shape.

imnotdream commented 1 year ago

Either of those would work, in my opinion, and I think the colliders should be separate, as some might be trigger collisions, and some might be platforms