Match row connections

0 favourites
  • 3 posts
From the Asset Store
snake and ladder game with two characters: turtle and rabbit!
  • I am creating a game where I want to match a line of sprites from left of grid to the right side (and possibly vertically too but guessing that is really complex).

    So for example a grid of 8 x 8 sprites where the idea is to connect the left hand side to the right hand side.

    The main complexity i see though it the lines wont be straight they might start top left and end up bottom right to connect.

    hope this makes sense, any suggestions on where to start would be much appreciated!

    Edit: This is what I am trying to do, detect when there is a connection.

    <img src="http://www.curv.co.uk/Untitled-1.jpg" border="0" />

  • Ok, so I realised that I didn't really ask this question in the right way... So here is a little more info about what I am trying to do.

    I have a series of sprites, 1 for each grid piece (like picture above) and want to detect when the first red blob and the second red blob are connected via the sprites i.e. the sprites are like pipes.

    I have been looking into the A* algorithm, but I'm thinking maybe this isn't required!!

    Any suggestions welcome!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to understand exactly what you need but it's a little difficult. Basically, you want to find a way to determine whether or not the red dots are ultimately connected through the pipe network?

    I'd suggest you give each pipe piece a boolean variable, like "connected" or something, that is activated under two circumstances: the pipe is adjacent to a dot piece; or if it's adjacent to another sprite that has connected set to true. Check each instance every tick to see if these conditions are met. If they're not, set connected to false.

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