+ 2
touching screen in javascript
I'm making a car game and anytime i touch the screen the car everything on the canvas flickers which means it disappears for like some noticeable milliseconds and comeback real quick...how can i work around this? It works fine when entering through a keyboard though https://code.sololearn.com/WKuNgZyatOX4/?ref=app
4 odpowiedzi
+ 3
Maybe this is a bit better..
https://code.sololearn.com/WIhx3Lr5JSrF/?ref=app
0
Ok, I think I found the problem, it's an advance. Apparently the problem it's the background, if you remove the background, the road, it stops disappearing, in fact it appears too much
0
bro😂 what did you do? Thanks btw
0
Line 263, I added this
ctx.clearRect(0,0,500,700);
roadLoop();
And commented some code but I'm not sure what jaja😅
Ah and I added user-select: none; in the button's css to prevent the text in them from being selected.
Anyway, it still fails but it's more playable.