How do I know when pipes have joined correctly?

0 favourites
  • 4 posts
  • I'm making a pipe puzzle as part of a larger game and am looking for the best way to know when the correct sequence of pipes has been achieved.

    Like many pipe games of this kind, the player clicks each piece which rotates 90 degrees each time.

    The layout will be fixed, since it's a solve-once-and-move-on. But after experimenting and watching the very few video tutorials I could find, I think pinning connector sprites (the orange blocks) to image points on each piece may be the easiest way to do it.

    Ideally I'd like all the pipe pieces to be a single sprite make up of different frames. Likewise, there to be a single connector sprite with multiple instances, but so far I can't work out how to do this.

    If they are all separate sprites I can use

    On start of layout > Pin spr_connector_1 to spr_pipe_1 Image Point 1

    > Pin spr_connector_2 to spr_pipe_1 Image Point 2

    > Pin spr_connector_3 to spr_pipe_2 Image Point 1

    And make the game complete when

    spr_connector_1 is overlapping spr_connector_2

    spr_connector_3 is overlapping spr_connector_4

    spr_connector_5 is overlapping spr_connector_6

    etc etc

    but this seems quite an inefficient way of doing it.

    I'm sure there is a better way and would appreciate some guidance on how to achieve the same result in a more appropriate method.

    Another way I was thinking was to have the connector sprites not pinned to anything - just being set to a fixed position, but don't know if this would scale well across different platforms (outside of html5).

    Many thanks :)

  • There's a Plumber Puzzle example in C3, in Advanced Examples. Looks like they used overlapping of image points as well. Maybe check it out to see how they did it. ;)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Lancifer - much appreciated! I have looked at the Plumber Puzzle but, alas, the advanced examples are well above my current skill level.

    In a tutorial (for C2) I found on YouTube, they have used each pipe piece as a separate sprite and this may be the way I have to go until I can upskill :)

  • Not the best way I'd imagine, but functional at least :)

    Separate sprites, with correct sequence based on angle of sprites.

    dropbox.com/s/l6xgfeq312wffst/pipes-separate.c3p

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