Javascript game, on touch or tilt the screen ? | Sololearn: Learn to code for FREE!

+6

Javascript game, on touch or tilt the screen ?

want to creat a mini game, like Galaga arcade, but I don't know how to directing the ship tilting the screen or touching right or left side of the screen... (game code in javascript :P I will learn python and C# and C++ after. for Java, I don't want ^^)

7/28/2017 9:18:05 AM

NoxFly

3 Answers

New Answer

+17

https://code.sololearn.com/WsgLFXPX087P/?ref=app

+14

Use ondevicemotion and ontouchmove/ontouchstart events......

+6

yes like this, thanks :)