0x7f: Tried you game today , ( great coding and game btw.
)
On my mac it run 100% smooth no jitter, same with my ipad.
On my slowest oldest android the FPS is around 20-30 when playing the game , this will produce some jitter , but i found by limiting the "spikes" that comes from the fps drops when the device is doing something else in the background will limit the jitter enough to make it playable even on low fps. code changes:
This is ONLY for real SLOW devices, but can be used on all.
You know where it goes
, mainly it use average move values instead of just taking the fps drop/move spike in one go , and limit the max spike.
//limit player movement.
lastviewx# = GetSpriteX(2)
lastviewy# = GetSpriteY(2)
newviewx# = (lastviewx#+ (x#-(joystickX#/(speed#/2.0)*GetFrameTime())) )/2.0
newviewy# = (lastviewy#+ (y#-(joystickY#/(speed#/2.0)*GetFrameTime())) )/2.0
addvx# = newviewx#-(x#-(joystickX#/(speed#/2.0)*GetFrameTime()))
addvy# = newviewy#-(y#-(joystickY#/(speed#/2.0)*GetFrameTime()))
// limit huge difs when mobile is doing something else and raise frametime.
// if frametime get lower then 30fps the addvx could get large and give jumps.
if addvx# > 4 then addvx# = 4
if addvx# < -4 then addvx# = -4
if addvy# > 4 then addvy# = 4
if addvy# < -4 then addvy# = -4
newviewx# = GetSpriteX(2) - addvx#
newviewy# = GetSpriteY(2) - addvy#
SetSpritePosition (2, newviewx#, newviewy# ) // <-- working slowly! a bit better now!
EDIT: Ohh forgot also changed playerx,y to float.
WINDOWS 10 on my laptop , WELL i sure had jitter even if the game was perfectly able to run above 60 fps , and i had vsync on, Windows10 still jitter , but i found that this is a windows 10 problem. And a simple fix is to let Windows10 know this is a game running , it will then make sure to set all windows timers to allow vsync to work ( and disable ALL the internet info win10 "always" sent all the time, that really gives fps drops ).
Good thing is that Microsoft know this and made this available:
While playing your game in AppGameKit 'press': [WindowsKey] + [G] , and enable the "game bar".
This will enable game mode ( it will remember it ) , and completely removed ALL jitter i had in your game on windows 10. ( i really fell for you, using so mush time for something like this ).
Paul: Due to battery saving they limit timing so mush that gpu sometimes skips frames, so dont think AppGameKit itself can do anything about it, but perhaps you find a way to always enable game mode ?
best regards Preben Eriksen,