look at this it will help
[lua]local physics = require “physics”
physics.start()
local localGroup = display.newGroup()
local bottom = display.newRect(0,768,1024,5)
local bottom1 = display.newRect(0,768,1024,5)
bottom1.x = bottom.x + bottom1.width
localGroup:insert(bottom)
localGroup:insert(bottom1)
physics.addBody(bottom,“static”)
physics.addBody(bottom1,“static”)
local bg = display.newImage(“bg.png”)
localGroup:insert(bg)
local bg1 = display.newImage(“bg.png”)
bg1.x = bg.x + bg1.width
localGroup:insert(bg1)
local hero = display.newCircle(0,0,15)
hero.x = 50
hero.y = 450
localGroup:insert(hero)
physics.addBody(hero,{density =1})
local function manageScreen()
localGroup.x = 50 - hero.x --as 50 is initial pos of hero
end
Runtime:addEventListener(“enterFrame”,manageScreen)
hero:applyForce(150,0,hero.x,hero.y)[/lua]
Note :- plz chk it with config setting of 1024*768 in other it might not work
[import]uid: 12482 topic_id: 11209 reply_id: 40650[/import]