Search the Community
Showing results for tags 'double-tap'.
-
I am a complete newbie in PhaserJS. I am trying to develop a game in PhaserJS where tapping the screen once should make the user avatar move on the screen and double-tapping should make it jump. However, I am not being able to figure out how to detect the double tap event. I have seen this tutorial in their official documentation, but that didn't work. When I am putting this line game.input.onTap.add(onTap, this); in the function create(){ ..... } function, it is showing this error Uncaught TypeError: Cannot read property 'add' of undefined I am being able to detect single tap events using this code: if(game.input.onTap && player.body.touching.down){ player.setVelocity(-530); } I've read another thread where the members have commented that to detect double click, one should start a timer and check if both the clicks are coming within a threshold value. However, I think this is not a foolproof method and there must be a better way of doing it. Can anyone please help?
-
If so what is the event name?
-
Does anyone know how to use pointer events to detect double-tap and double-click? I'm using the pep.js framework and can't see anything in there. Basically I just want to be able to double-tap my meshes on the screen to select them. The dblClick event runs beautifully on desktop but unfortunately there is no equivalent for mobile devices. I realise I could write my own with a timer but I was hoping to make my code a lot cleaner by using a single event.
- 2 replies
-
- pep
- double-tap
-
(and 1 more)
Tagged with:
-
Hi, I'm trying to make my character charge forward if the player double taps on any of the control keys, but I can't figure out how to do it. Is there any built in functionality for this that I'm missing? I could settle for checking if the player quickly taps the key, and I tried to use a combination of key.onUp and key.duration to see if the keys was pressed for a very short time, but this doesn't really seem to be very precise (or I'm doing it wrong ). Would be grateful for any help or any suggestions!