hello, i’m making a infinite vertical scroller and using a Perspective camera (from CalebP) to track object as it going up. but i need to camera track only when object is going up and when object fall from bottom screen to stop track. i can’t figure how to set bounds or what have i missing.
this is my code:
in scene:show i set bounds
camera:setBounds(centerX,centerX, -screenH, centerY) camera:setFocus(hero) camera:track()
and have enterFrame function (levelsize = -display.contentHeight)
function setLevelBound() if (hero.y \< levelsize) then --print("SET BOUNDS NEW") camera:setBounds(centerX,centerX,levelsize\*2, centerY) levelsize = levelsize \* 2 end --if (platformS[first].y \< hero.y) then --print("--x--") --camera:setBounds(centerX,centerX,levelsize, hero.y) --end end
i have comented out if stat. because i don’t know if i’m on right track with this. It is working going up.