I made a gist to show what I am working at right now: a platformer with a controller drawn on the screen which the user could touch to move the hero.
This is just a proof of concent to understand the problem.
From desktop, when the user moves the mouse on one of the buttons of the joypad (the four red boxes), the hero (a blue box) moves according to the direction pressed. It works fine.
From my Android device (Huawei P8 Lite), when I touch a button the hero is moving as well, but with a bit of delay.
The real problem comes once I swipe from outside a button and then my swipe crosses the button: the hero moves but the delay from when the swipe crosses it and hero's movement increases as the distance between the initial touch and the button increases, causing the "game" to be unplayable.
Each frame the code checks the coordinates of a touch (or mouse) event, and move the hero only if it happened in one of the buttons' position. It's like the entire code is too slow to perform in real time.
Any suggestion?
Hi,
I made a gist to show what I am working at right now: a platformer with a controller drawn on the screen which the user could touch to move the hero. This is just a proof of concent to understand the problem.
From desktop, when the user moves the mouse on one of the buttons of the joypad (the four red boxes), the hero (a blue box) moves according to the direction pressed. It works fine. From my Android device (Huawei P8 Lite), when I touch a button the hero is moving as well, but with a bit of delay. The real problem comes once I swipe from outside a button and then my swipe crosses the button: the hero moves but the delay from when the swipe crosses it and hero's movement increases as the distance between the initial touch and the button increases, causing the "game" to be unplayable. Each frame the code checks the coordinates of a touch (or mouse) event, and move the hero only if it happened in one of the buttons' position. It's like the entire code is too slow to perform in real time. Any suggestion?