Here’ an example to help with your first problem [lua]local function randomStuff()
boosters.x = math.random( 960 )
boosters.y = 300 - math.random( 5000 )
boosters1.x = math.random( 960 )
boosters1.y = 300 - math.random( 5000 )
boosters2.x = math.random( 960 )
boosters2.y = 300 - math.random( 5000 )
boosters3.x = math.random( 960 )
end
timer.performWithDelay( 0, randomStuff, 1 )[/lua]
That is not all you will need for a good effect but, should help you for a start. For your second question if your background is static then you can just say bg.y = character.y however if your bg is meant to change as your character progresses what I did is made the image in photoshop and then cut it into smaller pieces and created some functions like these, [lua]local function controlBG1()
if ship.y > -240 then
local bg1 = display.newImageRect(“bg1.png”,960,500)
game:insert(bg1)
bg1.x = 0; bg1.y = 240
bg1:toBack()
elseif ship.y < -240 then
game:remove(bg1)
end
end
Runtime:addEventListener( “enterFrame”, controlBG1 )
local function controlBG2()
if ship.y < 338 then
local bg2 = display.newImageRect(“bg2.png”,960,500)
game:insert(bg2)
bg2.x = 0; bg2.y = -260
bg2:toBack()
elseif ship.y > 338 then
game:remove(bg2)
end
end
Runtime:addEventListener( “enterFrame”, controlBG2 )[/lua]
Keep in mind the texture memory on mobile devices is quite limited so youre going to have to optimize your background so it’s not to large otherwise it will cause your game to lag. Hope I helped [import]uid: 11465 topic_id: 6471 reply_id: 22606[/import]