renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
326 stars 64 forks source link

Rapt game touch seems super delayed on Android #86

Closed umbe1987 closed 3 months ago

umbe1987 commented 6 years ago

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.

pos1

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?

MeloMellow commented 4 years ago

Hello dude, did you fixed it?