Hi All - thanks for the various posts and apologies for the late reply...Easter hols etc.
No qualms sharing my code but it's over 1700 lines so far, with much repitition, so I'll take you through all the key parts.
I set my screen up as follows (to use a virtual resolution)
SetVirtualResolution(1080,1920)
SetDisplayAspect(0.5625)
SetOrientationAllowed(1,1,0,0)
EnableClearColor(0)
I load images as follows:
coin01 = loadimage("items/32coin.png")
and create array-held sprites as follows
CreateSprite(2,coin01)
coin[1] = 2
SetSpriteSize(coin[1],100,100)
SetSpriteDepth(2,1100)
setspriteshape(2,3)
for t = 2 to maxcoins //largest number of expected sprites onscreen at once
coin[t] = CloneSprite(2)
next t
After a basic menu screen I layout my sprites in their starting positions (off-screen at 1100,2000) and make them invisible. The main game loop then takes over and reads my map array and places the sprites in the appropriate position across the top of the sceen (hidden by a score panel initially). It goes through the sprite array until it finds a sprite that is off-screen (i.e. not being used) then puts it in position and makes it visible.
select surfacelevel[levelrow,t]
case 1 //Coin
for s = 1 to maxcoins
if getspritey(coin[s]) >= 1920
if t = 1 then SetSpritePosition(coin[s],162+94,220-288+94-differential#)
if t = 3 then SetSpritePosition(coin[s],450+94,220-288+94-differential#)
if t = 5 then SetSpritePosition(coin[s],738+94,220-288+94-differential#)
SetSpriteVisible(coin[s],1)
exit
endif
next s
endcase
In the above code the differential# is just a variable that tells me how much to offset the Y coordinate by, based on the position of the sprites on the previous row, so that they all join up nicely.
Then I manually scroll all sprites on screen as follows:
//Coin
for t = 1 to maxcoins
zz = getspritey(coin[t])
if zz<1921 then setspritey(coin[t],zz+gamespeed#)
next t
Then I detect collisions as follows: (in this case it is a pick-up so the score is incremented and the sprite is put back off-screen and made invisible, ready to be re-used).
// Coins
for t = 1 to maxcoins
if getspritecollision(swimmer,coin[t]) = 1 and swimmerdepth = 1000
SetSpriteVisible(coin[t],0)
SetSpritePosition(coin[t],1100,2000)
inc scorecoins
endif
next t
(Swimmer is the player sprite). And those are the main nuts and bolts - obviously these elements are repeated for each sprite I have (other items, background sprites etc.) and there is a routine to detect player swipe, manage gameover etc but these are the bits of code I am using to perform all the on-screen draws. Finally at the end of the main game loop is a
I am using an HTC One, so not an old or underpowered phone, I have tried remming-out a bunch of sprites (including all background sprites) so literally only have the coins and a few others on screen (40 sprites of less than 100x100) and I still get the same problem.
I'll put together a build and add a link for you to try on your own devices to see if you get the same issues....but in the meantime do you see anything obviously wrong? As mentioned previously, the stuttering applies to the whole screen, does not appear to occur on specific events (e.g. each time a new row of sprites are drawn) and is unaffected by reducing the number of sprites on screen. This is what still makes me think it is environmental on the phone...possibly the application is not getting the main processing thread etc. But I am just guessing.