I'm making a spaceship (top down) game which requires a lot of background decoration.
I've tried two different approaches so far to generate clouds. These 'clumps' consist of 30-40 pngs (of which have varied alpha and rotation applied to them in code).
The clumps are recycled when they go off screen (re-rotated and alpha applied) and then reintroduced in their new form.
Typically, if I'm only ever moving the parent object (the clouds move from top to bottom) - and unflattening or batch resetting only occurs when clouds are re-composed - what is going to give me best performance on mobile?
Is it even worth using QuadBatch? Urgh. Has anyone done anything similar to this?
//recompose (happens when cloud has gone off screen)
if(_type == PILLAR)
var lastY:Number = 0;
var lastHeight:Number = 2;
var lastX:Number = 0;
for(var i:int = 0; i < _cloudCount; i++)
var cloud:Image = _clouds[Rand.getIntRange(0, _clouds.length-1)];
cloud.alpha = Rand.getNumberRange(.1,.3);
cloud.rotation = Calc.rad(Rand.angle);
var yIncrement:Number = (i == 0) ? 0 : Rand.getNumberRange(1, lastHeight/2);
var cY:Number = (i == 0) ? 0 : lastY + yIncrement;
cloud.x = x + Rand.getNumberRange(-50, 50);
cloud.y = cY;
_compositionHeight += yIncrement;
lastX = cloud.x;
lastY = cY;
lastHeight = cloud.height;
The batch is added to a container sprite which is simply being moved on the 'y' axis within my update loop.