Smarter camera movement - any pros around?

Hi, I am having a screen that has the double size of the height. I am having a camera that moves when the character in the game moves upward the screen. It works fine but I want to fine tune this camera movement, because when the player is on the top of the screen and is moving downwards - I can’t see what below because the camera is to high up.

 --Control camera movement   
 if(player.y\<250) then  
 gameGroup.y = ((ball.y \* -1) +250)-5  
 ball.jumping = true  
 end  

So in the best world I would like to have a camera that always centers the player, if the camera is not going further and lower then the bottom and top of my screen.

Any one, who has implemented this little smarter camera approach?

Joakim [import]uid: 81188 topic_id: 21120 reply_id: 321120[/import]

the only thing i saw was to change this:

gameGroup.y = ((ball.y \* -1) +250)-5  

to this:

gameGroup.y = -ball.y + 245  

that is all i do, not sure what you mean by the rest, but what I’m thinking is just make another function:

[code]
if(player.y>320) then
gameGroup.y = -ball.y + 340
ball.jumping = true
end [import]uid: 38977 topic_id: 21120 reply_id: 83888[/import]