How to implement Touch (X & Y) for 2 players on same screen?

Get help using Construct 2

Post » Tue Oct 13, 2015 9:52 pm

Hi..

For an example, imagine a Air-hockey type of game (horizontally), split in two halves with a vertical line in the center.

Now to control the paddles, I cannot find a way with the existing Touch events like "Nth touch", because in Two-player game, any player can lift and press their touch at anytime, which will change the N'th number.

Can someone please help me with an algorithm to enable controlling two objects' position (X and Y), based on the nearest Touch?

Note: I already tried with: If Touch.X > Layout.Width/2, and its Else. But the action (let's say Paddle.X set as Touch.X) does not refer to the correct player's touch.

Please help,
Thanks!
B
10
S
2
Posts: 109
Reputation: 982

Post » Wed Oct 14, 2015 6:15 am

Would "Drag and Drop" behavior work for what you want? It works that way already. Two things can be dragged at the same time.
B
240
S
62
G
33
Posts: 903
Reputation: 40,589


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests