I would like to learn how to make mobile games. The game I'm working on is using swipe detection. After watching some tutorials I put together this code:
var swipe_start = null
var minimum_drag = 100
swipe_start = event.get_position()
if swipe_start == null:
var swipe = swipe_end - swipe_start
if abs(swipe.x) > minimum_drag:
if swipe.x > 0:
This code should determine if the user swiped and in which direction (left or right). Also, in the Input Map I chose "click" to be left mouse click.
The game works when I'm playing on my laptop (I click and drag with mouse) so I published it on google play but when you play the game on phone the swipe detector doesn't work.