Android: relative movement (logic question)
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Android: relative movement (logic question)
Ok, so I have worked out a system for relative movement for the player. When one touches the screen or releases from a multi-touch the single finger position is recorded,. and the player is moved relatively to any movement after that. This works how I like,. however if you quickly rock two fingers back and forth (touch un-touch) you can make the player obj jump positions,. this is an unwanted behavior that I can not find a way to eliminate. Any help with my apparently flawed logic much appreciated,. I have banged my head against this for some time now, to no avail. thanks.
- Attachments
-
- move_relative.zgeproj
- android touch test,.
- (2.1 KiB) Downloaded 428 times
iterationGAMES.com
Hi Jph, I started to create own code from the scratch because I thought I can create something simpler, but when I finished and look back at your code
... hmm...I wrote almost the same thing
Anyway, I have a suspicion that the problem with rocking of two fingers is that touchGetCount() does not return 0 between two touches if you're doing it very quickly; just jumps from one position to another. Therefore, I tried to restrict delta distance of a new position from the previous one. If it is too long (I used a stupid constant for any direction), model is not moved. Of course this disallows quick movements of finger, but how else to recognize fast finger move from flickering?
... hmm...I wrote almost the same thing

Anyway, I have a suspicion that the problem with rocking of two fingers is that touchGetCount() does not return 0 between two touches if you're doing it very quickly; just jumps from one position to another. Therefore, I tried to restrict delta distance of a new position from the previous one. If it is too long (I used a stupid constant for any direction), model is not moved. Of course this disallows quick movements of finger, but how else to recognize fast finger move from flickering?
- Attachments
-
- RelativeMovement.zgeproj
- touch test 2
- (2.28 KiB) Downloaded 458 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact: