Question on touchscreen inputs

48 views
Skip to first unread message

Dong Cha

unread,
Apr 19, 2025, 7:31:22 AMApr 19
to PuzzleScript

Hi, this isn't really directly about puzzlescript but i'm making a puzzle game in Godot and have been trying to implement a touchscreen input/method similar to puzzlescript. I just want a simple movement where sth moves when swiped and keeps moving when finger isn't released. I've tested some mobile games but none seem to be as smooth as puzzlescript's html touchscreen inputs. It'd be great if anyone can provide some help...

Some questions I have:

- if initial speed/time of swiping matters (if feels like puzzlescript take this into account)

- how it measures distance for a valid swipe (number of pixels or relative to viewport size)


Stephen Lavelle

unread,
Apr 19, 2025, 7:37:33 AMApr 19
to Dong Cha, PuzzleScript
The code is here, fwiw

I didn't implement it, but isSuccessfulSwipe / proto.swipeStep  and the "(function (proto) {" bit generally seems to be the core of what you might be interested in.  It looks like it's just based on pixels, and doesn't take pixel density into account - seems to be counting pixels.  (But pixels in the browser can mean a different thing than screen pixels - in fact rarely do they correspond 🥲  )

--
You received this message because you are subscribed to the Google Groups "PuzzleScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puzzlescript...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/puzzlescript/3683c201-78f3-4396-ba59-3c63d8f9a073n%40googlegroups.com.

Dong Cha

unread,
Apr 19, 2025, 4:26:36 PMApr 19
to PuzzleScript
That's exactly what I needed. Thank you!

2025년 4월 19일 토요일 오후 8시 37분 33초 UTC+9에 Stephen Lavelle님이 작성:
Reply all
Reply to author
Forward
0 new messages