Im using a custom camera with lerp scrollx and scrolly to playerx and playery. It works nicely. Now my biggest issue is to achieve the camera the way I want.
I have set my window size to 320x200. I like to keep the player at a low height, kinda like a Super Mario feel. Now the problem is if I have a big layout the camera will get right in the center of the screen. Not sure if I make myself clear.
This is what I want:
Keeping the character about that height on the screen. That's because the Layout size is about the same as the screen size.
This is what I get when I increase the layout size:
I do not like the way it looks and I can't seem to find a way to keep it always look like image #1 even if the layout is big.
Maybe something like:
ScrollY = player.Y - 60
Develop games in your browser. Powerful, performant & highly capable.
Is a gold mine of information regarding camera logic.
Basically, you do not want to use scrollto on your player object. You'll be using an invisible helper sprite, lets call it "camera" and scrollto that. You will be moving the camera object around with constraints (min(), max(), and clamp()) based on player position and your preferred logic.
But from the video you can see how much consideration goes into having excellent viewport camera logic.
Thanks for the answer, specially oosyrag
Would like to listen to more suggestions!
More info from the creator of that video. http://blog.mimeoverse.com/post/5814677 ... d-minimize