notnullgames / tiled-kaboom

Load maps made in Tiled into Kaboom!
https://notnullgames.github.io/tiled-kaboom/
20 stars 3 forks source link

physics / collision #5

Closed konsumer closed 3 years ago

konsumer commented 3 years ago

There is no built-in single way to setup collisions in kaboom, so I am hesitant to actually implement a ready-made sort of thing for this, but I could see a helper like getStaticBodies(map) being useful.

Tiled also has a nice "physics editor" that is per-tile (but sub-tile arbitrary shape) which is extremely useful for setting up the collision-shape of, for example, a coastline, so whenever you draw a coast between sand & water (like with a terrain-brush) it uses them. kaboom doesn't seem to do collisions with this much granularity, but it definitely seems worth exploring making a helper to make using these easier. I could even see it being a separate kaboom plugin.

An initial idea might be a per-tile collision setup, where you add a collision=true property, then add a helper that can turn this into a bunch of kaboom collisions. This would make it simple to make non-granular collisions for simple games, and could be expanded later.

Relates to #1

konsumer commented 3 years ago

I am going to close this, as I think it is out of scope for this plugin. A user can use the map object data to build up collisions however they like.