Hi all,
I've been working on a sidescrolling game for Android phones and have run into problems in making it run efficiently. The most annoying bug is when starting the game it pauses seemingly at random when changing the content view from the menu to the view where the SurfaceView resides. I don't know how to judge why this is happening. Perhaps it's when registering the sensor listener?
Beyond that, I'm getting around 40 FPS when drawing one layer of tiles on the screen, the player, and one enemy. This seems quite low, and drops to around 25-30 when drawing a 320x240 background and three 150x50 clouds on the screen. Adding a second layer of tiles would drop it to below 20 which seems unacceptable. Is this normal for Android games?
My screen is using 16x16 tiles by running through a 2D array, but only the pertinent tiles are being accessed and drawn through the array. I don't create any new objects in functions (most specifically, draw and update functions), only use existing ones belonging to each class in my game.
What sort of things can I do to increase performance in SurfaceView games in Android?




