How do I find out if there is an object in a position?

0 favourites
  • 5 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • I am making a sort of "Dont Starve" game and I'm having trouble finding an object in a position.

    I want to do this because I want to adjust a "wall" sprite's image with its corresponding position.

    e.g.

    A B C

    D E F

    G H I

    In the above, the A position should be a south-east (r) shaped wall.

    The B position should be a south-east-west (T) shaped wall.

    The E position should be a north-south-east-west (+) shaped wall.

    and etc . . .

    I made all the versions of the wall as an animation so I just change the animation of an object to change the shape.

    The problem is, I can't find a way to find out if there are existing wall objects in the North, South, East, and West position of a newly placed wall.

    I need to find out if there are other walls so that I can set the new wall and the existing surrounding walls to the proper shape.

    Any tips?

  • Use overlapping test; 'is overlapping at offset' So you can check whether there is overlapping object at that offset position.

  • 'Is Overlapping at Offset' can be a real pain.

    Why and more about auto tiling is discussed here;

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks guys! I'll try to get something to work with your tips.

  • Ah adaptive sprite/tile aka bitwise operation:

    I modified R0J0 example, make it compact & intuitive (and touch friendly) bitwise_mod.capx

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