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

0 favourites
  • 2 posts
From the Asset Store
Surena Touch
$2.50 USD
A wrap from official Touch plugin to export touch/mouse input to other plugins.
  • 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!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Would "Drag and Drop" behavior work for what you want? It works that way already. Two things can be dragged at the same time.

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