PDA

View Full Version : Drag lagging on iOS 7



jugivi
08-01-2015,
I finally have my game out.... but there's a bug I couldn't figure out how to fix, and I was wondering if you guys can take a look and tell me what you think

If you get my game, just play a few rounds and you'll notice that, sometimes, the character that you control dragging left and right will lag. Sometimes the drag is really smooth, and sometimes is very choppy.

Link: https://itunes.apple.com/us/app/finger-boing-free/id728175134?mt=8

That only happens on iOS 7, on any earlier version the controls were always smooth.

Kagazshuraupdam
08-04-2015,
I finally have my game out.... but there's a bug I couldn't figure out how to fix, and I was wondering if you guys can take a look and tell me what you think

If you get my game, just play a few rounds and you'll notice that, sometimes, the character that you control dragging left and right will lag. Sometimes the drag is really smooth, and sometimes is very choppy.

Link: https://itunes.apple.com/us/app/finger-boing-free/id728175134?mt=8

That only happens on iOS 7, on any earlier version the controls were always smooth.

I've gone crazy trying all I could, but it's been impossible to find out what can be causing such a random behavior.

This is the code that does the dragging:
function bgcolor:touch( event )
if (gameRunning == false and dead == false and showingTutorial == false) then
startGame()
end

if (dead == false and showingTutorial == false) then
if event.phase == "began" then
display.getCurrentStage():setFocus( self, event.id )
self.isFocus = true
elseif self.isFocus then
if event.phase == "moved" then
local myx = (event.x)

gameBombController.x = myx
gameBomb.x = myx

elseif event.phase == "ended" or event.phase == "cancelled" then
display.getCurrentStage():setFocus( self, nil )
self.isFocus = false
end
end
end
return true
end I'd really appreciate if you guys can get the game (free) and take a look to get some fresh ideas.

Thank you very much

Kayla_Harris_0909
08-04-2015,
I've made a clean project to reproduce the issue.

Build and run this code on an iPhone 5 with iOS 7.

Just open the app, drag a few times the grey ball left and right, press the home button to close, and repeat.

You'll see that sometimes the ball drags smoothly, and some others it lags and has some choppy movement.

If you comment this line the issue stops happening and everything works fine:
Runtime:addEventListener( "enterFrame", animateBG );

This code is similar to the one in my game, except that if I comment that line (it makes the BG spin), I still hit the same issue, so there has to be something else making it happen.

With this project you can at least reproduce it and explore.