Well, this is my first post here, so hello everyone!
Ok, to the point. Right now I am creating an endless runner game and I’m trying to implement double-tapping. To be more clear:
The Player touches the screen for a short while -> the character jumps as long as the Player is touching the screen (to a maximum degree, obviously ) - this I have already implemented thanks to the Getting started tutorial.
The Player double taps the screen -> the gravity is “reversed”, in a way.
I’ve searched the forum for similar issues but couldn’t find anything like that or similar. I have also already implemented reversing/inversing the gravity but I have a huuuge problem when it comes to implementing the double tap.
I’ve tried action.repeated (and by the way learnt how it really works ) and even nesting action.pressed in a condition that contains action.released but id doesn’t seem to work. My guess is that those actions would have to happen really quickly, and I mean really quickly - in the same frame which is, well, next to impossible.
So, could you please help me out with this one? I’de be more than grateful! Thanks for your help in advance!
I implemented a gesture detector module that can be used to correctly identify gestures such as swipe-left/right, tap, long press and double tap. Take a look here: https://github.com/britzl/ludobits/blob/master/ludobits/m/gesture.lua Perhaps you can use it as inspiration for your own project?