0

DISCLAIMER: This may be a really simple and obvious question, but I am not experienced with javascript so sorry.

I'm hosting a website using digital ocean and have imported snake as one of the webpages from GitHub. Link: https://github.com/betamos/Snake-JS . Anyways this works perfectly when using on a PC/Laptop but the inputs obviously don't work for mobile devices. How do I fix this and make it work for mobile inputs, up down left and right. Something similar to when you google snake on safari on mobile, and you can play by moving your finger up down left or right.

Sorry if this is a dumb question but I have genuinely no idea how to make the javascript work for mobile inputs and couldn't find any questions with an answer that works for me, although I could have just not looked hard enough.

EDIT: Progress I've made so far is adding html buttons that can be clicked on mobile to move the snake. Although this works for now I still want it to work by just moving your finger up down right or left. As described above and can be seen in action by searching snake and pressing the top result by google on a mobile device.

0 Answers0