How do I restrict movement to horizontal or vertical only?

Get help using Construct 2

Post » Thu Mar 27, 2014 5:44 pm

what i need to do to restrict the swap movement to vertical or horizontal direction only? Thanks.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Thu Mar 27, 2014 5:57 pm

What's swap movement?
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Thu Mar 27, 2014 6:07 pm

7Soul wrote:What's swap movement?


Change position? In my case, of two neighboring sprites.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Thu Mar 27, 2014 7:12 pm

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
B
9
S
1
G
1
Posts: 9
Reputation: 673

Post » Thu Mar 27, 2014 7:37 pm

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...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Thu Mar 27, 2014 7:40 pm

federicoklein wrote: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.
Last edited by RBuster on Thu Mar 27, 2014 7:42 pm, edited 1 time in total.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Thu Mar 27, 2014 7:40 pm

BluePhaze wrote: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.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Thu Mar 27, 2014 7:53 pm

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
B
9
S
1
G
1
Posts: 9
Reputation: 673

Post » Thu Mar 27, 2014 7:55 pm

just quit the spaces. As i have less than 500 reputation i cant publish URLs (really i think that has no meaning at all)
B
9
S
1
G
1
Posts: 9
Reputation: 673

Post » Thu Mar 27, 2014 7:55 pm

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.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Nicolas951, Shenkai the ssj and 25 guests