Sprite collison based on tiles

0 favourites
  • 2 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • I am trying to tell the difference between what tile the sprite is colliding with. I am comparing it by the bounding box of the sprite. The tiles im checking are the two dirt tiles (1 and 2). Below is the event sheet I have, everything is working most of the time. The building should be red when touching the 2 dirt tiles. In certain positions though it is green. I debugged the logic and it comes down this section. Below is the images of the event sheet and the green and red building points.

    This one is where the certain position of where it turns green.

    This image is the way it should be and the difference is one tile. I am not sure what I am missing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok I figured this out. Originally I thought the bounding box included the whole sprite, instead it was only checking the position points. In order to fix this I had to split the sprite position points down some more so now Im not only checking the bound box points. I am also now checking points within the sprite.

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