How can I separate the screen into two equally big spaces which react to touch events indepently?

By Jonas1902

I am developing a relatively easy multiplayer game in android where two users can interact with the screen. I implemented onTouch differently, depending on the fact which side of the screen has been pressed. It then triggers either an action of player1 or player 2.

My problem is,that when both players press the screen simultaneously, there is a ACTION_MOVE triggered also, and not only two ACTION_DOWN events. The ACTION_MOVE has some specific implementation, but it should only be called when one player on his own causes it and not both together.

So, is there a way to separate the screen into to two areas so that the described problem will not arise?


Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273