0 Favourites

Is it possible to use tilemap for collision based events?

  • Hi guys.

    I am creating an RPG style game that uses tilemaps for it's graphics. For example I have trees and rocks that the player cannot walk through, I have pokemon style grass that have a random chance of starting a battle when walked over, I have doors and entrances that act as links to new rooms/layouts.

    Right now I can do all of this easily and accurately by creating invisible sprites and placing them exactly over the relevant tiles, then tying the events to collision of the invisible sprites. The problem with this, of course, is that I actually have to keep creating and placing all these invisible sprites, this takes time and it would be easy for me to make mistakes, placing them incorrectly or forgetting to place them in places!

    So yes. It would be extremely useful if I could tie an event or behavior to each tile in the tilemap, following the above examples, I would make all tree tiles have a solid behavior so the player cannot enter that tile.

  • Why not have multiple tilemaps on different layers that can represent different scene objects as well as collisions.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I do it the same way. I have the background as tilemap and then I draw transparent collision-boxes on houses, fences, rocks,... on a different layer. If you use "snap to grid" it is not to bad nut yes it is work to do. You might be able to solve it with a automated loop something like: for each tilemap = gras spawn transparent collision box on same position. This would save work but at the end there will be some more objects that could end up in a little performance loss.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)