Collision at direction - Tile Map

0 favourites
  • 2 posts
From the Asset Store
Two types of minimap: "full map" and "player is the center" (square map and radial map)
  • Hello everybody.

    I'm using tilemap and I wanted to detect if my character touched a tilemap block from the right, left, top or bottom. What is the best approach for this? I'm really confused by the documentation on this type of object.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It depends on the type of game you're making. If you're developing a platformer using the Platformer behavior, then you can use Platform has wall to right/left and Platform is on floor to check for bottom and side collision. To check for collisions with ceiling, simply test the overlap at ofset using Object is overlapping at offset 0 -5.

    If you are making a top-down game with a fixed size grid and grid-based movement, you should calculate the tile x and tile y at the player's position, and then check for neighbouring tiles using Compare Tile at Tile x Tile y

    Otherwise just use Object is overlapping at offset x y with offset that correspond to the 4 directions.

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