Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Dragging a sprite on Windows (Mouse) vs. Android (Touchscreen)

Author
Message
kaband
21
Years of Service
User Offline
Joined: 22nd May 2003
Location: Chicago
Posted: 24th Sep 2015 16:22
Hi All,

In the game I'm working on you must drag a sprite from the right hand side of the screen to the left. I've noticed a difference between behavior in windows vs. android.

On windows, the sprite sticks with the mouse arrow. I move the mouse and the sprite immediately goes with it.

On Android, there is a delay. The sprite moves but it lags behind my finger as I drag. Especially (of course) if I move my finger quickly.

Is this expected behavior or do I need to revisit my touchscreen code? Seems pretty straightforward code wise, so I'm interested in what others have experienced. I've tested on multiple tablets with the same result. FPS is 60 on those devices. I dont know if it makes any difference, but I'm broadcasting my app currently and haven't installed an .apk of it.

Thanks!
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 1st Oct 2015 21:39 Edited at: 1st Oct 2015 21:40
I've experienced this but have just assumed it's how touch screens work.

It depends on why the lag is an issue for your app. For mine it was more that the player's finger slipped off the sprite, the lag wasn't a problem. I was using the pointer commands and just checking to see of the pointer was hitting the sprite but with the lag issue it was easier for the player to move their finger off the sprite. So I used the multi-touch commands to detect a swipe gesture and this sorted the problem but not the lag.
Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 4th Oct 2015 21:04
I haven't tried drag/drop in android, but I do know that broadcasting introduces considerable lag compared to installing an APK. The device uploads commands to the pc where AppGameKit interprets and does its thing then sends back the result. Maybe try an install and use multi touch commands.
-mrradd-
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Oct 2015 22:50
did you have an example code how you drag this sprite?
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 17:35:22
Your offset time is: 2024-11-25 17:35:22