How do I restrict movement to horizontal or vertical only?

0 favourites
  • 11 posts
From the Asset Store
a full game example, menu system, with the first level and a boss, to create a horizontal shooter
  • what i need to do to restrict the swap movement to vertical or horizontal direction only? Thanks.

  • What's swap movement?

  • What's swap movement?

    Change position? In my case, of two neighboring sprites.

  • Dont really understand your question.

    If what you want is swapping to sprites i would try sometihng like

    spirte1.setposition to sprite2.X & sprite2.Y

    Sprite2.setposition to sprite1.X & sprite1.Y

    Dont know what you are really asking

  • Imagine a match 3 game, you don't want them to move diagonal, just in the vertical or horizontal ... at least that is what I get from his question...

  • Dont really understand your question.

    If what you want is swapping to sprites i would try sometihng like

    spirte1.setposition to sprite2.X & sprite2.Y

    Sprite2.setposition to sprite1.X & sprite1.Y

    Dont know what you are really asking

    I want to make a puzzle in which the pieces can be swapped to only if they are above or on the side (right / left). I want to restrict the direction for not to swap diagonally.

  • Imagine a match 3 game, you don't want them to move diagonal, just in the vertical or horizontal ... at least that is what I get from his question...

    Exactly. Thanks for understanding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry as im not a native english speaker ( I am from Uruguay) somethings dont really understand 100%.

    I am not making and had never made that kind of game, but maybe this tutorial helps you:

    http:// gamedevelopment.tutsplus. com/ tutorials/ make-a-match-3-game-in-construct-2-animations-and-block-swapping--gamedev-8354

  • just quit the spaces. As i have less than 500 reputation i cant publish URLs (really i think that has no meaning at all)

  • You may want to look at the Match 3 game tutorial, I believe it covers it. I don't have the link handy, but if you search google/bing for "Construct 2" + "match 3" + tutorial

    you should find it.

  • Actually I've seen this tutorial, but I wanted a simpler solution (no arrays). My puzzle has only 18 pieces.

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