D
D
Dmitry2018-06-24 18:51:25
Angular
Dmitry, 2018-06-24 18:51:25

How to read gestures from phone in angular5?

Hello. I wrote the game "snake" in angular and decided to make it possible to play on the phone. But I ran into a management problem. I don’t know how to control gestures so that the snake moves up, down, left, right (now on wsad keyboard buttons)
What came to mind:
1) there are touch event handlers in JS. You can use it .. but for now xs
.
I didn't really read the docks yet
4) Add 4 buttons and don't worry. But this is if I despair.
Maybe someone has come across this and will suggest an option (with an example). I will be grateful )
PS: why are the tags not being saved?! ionic, hammerjs...weird

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-06-24
@Zamay

If someone needs it, then this is easily done through hammerjs.

V
Vladimir, 2018-06-24
@Casufi

https://developer.mozilla.org/en-US/docs/Web/API/T...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question