Shahdee Posted November 8, 2018 Share Posted November 8, 2018 Hello, wonderful community! Seeking for advice from experienced developers. I'm making an HTML5 game with Pixi for Facebook IG platform. And initially I've encountered a problem with handling touch events. I'm subscribed to touch events like this: document.addEventListener('touchstart', onDocumentTouchStart, {passive:false}); document.addEventListener('touchend', onDocumentTouchEnd, {passive:false}); So whenever I tap on the screen with one finger, the circle should rotate in one of 2 directions. But, sometimes touchStart isn't invoked and the circle stops when instead it has to rotate continuously. The bug isn't reproduced in 100% cases and most probably it occurs when I'm playing the game in Fb IG environment. This is clearly seen on the video attached. I have no clue why this is happening, so any advice is highly appreciated ? P.S. I have this line added to index.html, so my guess is that 300 ms delay isn't the case here, but, I might be wrong. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> Quote Link to comment Share on other sites More sharing options...
SahJ Posted November 9, 2018 Share Posted November 9, 2018 I had the same problem with IOS devices, we have to find another method to simulate the touch start Shahdee 1 Quote Link to comment Share on other sites More sharing options...
Shahdee Posted November 10, 2018 Author Share Posted November 10, 2018 On 11/9/2018 at 10:37 AM, SahJ said: I had the same problem with IOS devices, we have to find another method to simulate the touch start Hello! Thanks for answering me. Could you give me a clue how you simulated touch events differently? Quote Link to comment Share on other sites More sharing options...
SahJ Posted November 15, 2018 Share Posted November 15, 2018 The problem is that touch.end does not work very well on iphone, put a time limit for example Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.