How do I detect an automatic terrain path?

  • See what I want to say on my youtube video

    https://www.youtube.com/watch?v=7fmhx77JxaE

    In this situation, i programed each condition of terrain.

    Have a way to make this more easy?

    If have a grass block, and I click on it, its will become a circular dirt block.

    If have a Dirt block, and I click on the side block, both will become a "U" dirt block.

    And so on.

    And I have a "T" Block, for two diferent path, "X" block to three and "L" block for curve.

  • You're looking for "bitwise" or "neighbor aware" auto tiling. The should be some working examples floating around the forums if you do a search.

    Ref: http://www.saltgames.com/article/awareTiles/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I did this before in my cellular automata cave generator. The solution was fairly simple... I did a "for each tile" loop and check for overlap at offset each surrounding tile... and did a comparison of an instance variable for each tile (I used a variable to keep record of the type of tile in that particular place).

    As Oos said, it's called bitwise method. The tricky part happens when you might have tiles next to each other that you want to behave differently than the method would do by default.

    ~Sol

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