You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.
Ideally, the touches array shouldn't be pre-populated like it is now. It should probably be an object where you add a key using the identifier and create the object on touchstart, update it using the identifier on touchmove and then deleted it on touchend.
I'm happy to have a stab at a PR if that's of interest (I understand the code is getting migrated so I'm not sure which bit to work on).
The text was updated successfully, but these errors were encountered:
Having a closer look at it, it messes up the current state of things quite a bit, particularly auto-generated methods which won't work if using a dictionary/object (and if they do, they'll expect the identifier, which isn't a number you can calculate).
However I believe I have an implementation with a dictionary which covers the lifecycle of the touch events (inc. mouseDown simulation). It's just that Sup.Input.isTouchDown(0) won't work (in the current state of things). It might be worth looking at because the current implementation is entirely broken anyway.
Hi there,
I've tried my prototype on iOS (emulator and physical) and I've had some problems. It seems like the touch handlers are using the
touch.identifier
(https://developer.mozilla.org/en-US/docs/Web/API/Touch/identifier) as the index for touches, howeveridentifier
only guarantees to have a unique ID per touch/finger and doesn't stay between 0-10 (see also: http://stackoverflow.com/questions/25008690/javascript-ipad-touch-event-identifier-is-continually-incrementing).Because of this, this line https://github.com/superpowers/superpowers-game/blob/master/SupEngine/src/Input.ts#L377 completely kills the Input loop on iOS.
Ideally, the
touches
array shouldn't be pre-populated like it is now. It should probably be an object where you add a key using theidentifier
and create the object ontouchstart
, update it using the identifier ontouchmove
and then deleted it ontouchend
.I'm happy to have a stab at a PR if that's of interest (I understand the code is getting migrated so I'm not sure which bit to work on).
The text was updated successfully, but these errors were encountered: