Game continued Scrolling LAG Air For Android
Hello,
I develop a game for android and ios with animate cc and i have red a lot of discussions to improve performance on mobile but i have still a lag (drop framerate) when scrolling.
View my game like Flappy Bird or like a Runner game, obstacles which are scrolling continued to the left and a character wich jump.
FPS = 60 and i use last version of AIR SDK.
The game works perfectly on PC, on Galaxy S6 it works almost perfectly, but on Galaxy S4 and Smartphones less powerful, there are lags while scrolling.
So, i have made a test, with just two elements :
- An image (PNG)
- A button (made with PNG image)
When i tap on the button, the image move to the left by 5px each frame with "EventEnterFrame" .
With this test, the problem is the same. On Galaxy S6 no lag but on Galaxy S4 a random lag during the scroll.

Here is the simply code :
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// imports and settings
import flash.display.BitmapData;
import flash.display.Bitmap;
Multitouch.mapTouchToMouse = false;
Multitouch.inputMode=MultitouchInputMode.TOUCH_POINT;
stage.align = StageAlign.TOP_LEFT;
// create a bitmapdata with my image on library and place it on right of the screen
var bmpData:BitmapData=new MyImagePNG();
var bmp:Bitmap=new Bitmap(bmpData);
addChild(bmp);
bmp.y=200;
bmp.x=600;
// Add button listener
btn.addEventListener(TouchEvent.TOUCH_TAP,buttonFunction);
// function for the button
function buttonFunction(e:Event)
{
btn.removeEventListener(TouchEvent.TOUCH_TAP,buttonFunction);
// add a enterFrameEvent to move image
addEventListener(Event.ENTER_FRAME, moveImage);
}
// moving image
function moveImage(e:Event)
{
bmp.x-=5;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I don't understand why with just two elements the scrolling doesn't work perfectly...
Have you an idee or a trick to solve this ? Because Galaxy S4 is not so old and a lot of mobiles are less peforming than his, so the game will not problably work very good on a lot of mobiles...
Thanks !!! ![]()
