I have an image (ground) with transparent pixels on top of it since the ground has hills like ups and downs ... the problem is that the ball isn't moving down and up according to the hills ... the ball is just floating over the image. what can I do ??
local bg2 = display.newImage("images/ground.png",true)
bg2:setReferencePoint(display.CenterLeftReferencePoint)
bg2.x = 0; bg2.y = _H/1.25;
local physics = require("physics")
physics.start()
local redOrb = display.newCircle( 0, 0, 25)
redOrb:setFillColor(255,0, 0)
physics.setGravity(0,9.8)
redOrb.x = 180; redOrb.y = 190; redOrb.rotation = 5
physics.addBody( bg2, "static", { friction=0.5, bounce=0.3 } )
physics.addBody( redOrb, { density=3.0, friction=0.5, bounce=0.3 } )