I've checked a lot of topics about this, but I can't seem to find the solution to the problem that i have.
I'm making a small 2D sidescrolling game, my level looks like this:
http://www.woutr.be/dump/levels.fla-20101110-212027.jpg
I want my player to always be in the middle of the screen, on the x axis that's no problem, but the y axis is something else.
For instance, the red rectangle is my screen, the yellow thingy is the player:
http://www.woutr.be/dump/levels.fla-20101110-212132.jpg
When the player jumps now, the camera shouldn't move on the y axis because both floor and ground are visible.
But when my player jumps in the following scenario, the y axis should change because the level is going up:
http://www.woutr.be/dump/levels.fla-20101110-212254.jpg
How could i create a camera like this, I could check if both floor and ground are on the screen, if not, follow the player on the y axis.
Would this method work? Or do you guys have another suggestion for me?
I'm making a small 2D sidescrolling game, my level looks like this:
http://www.woutr.be/dump/levels.fla-20101110-212027.jpg
I want my player to always be in the middle of the screen, on the x axis that's no problem, but the y axis is something else.
For instance, the red rectangle is my screen, the yellow thingy is the player:
http://www.woutr.be/dump/levels.fla-20101110-212132.jpg
When the player jumps now, the camera shouldn't move on the y axis because both floor and ground are visible.
But when my player jumps in the following scenario, the y axis should change because the level is going up:
http://www.woutr.be/dump/levels.fla-20101110-212254.jpg
How could i create a camera like this, I could check if both floor and ground are on the screen, if not, follow the player on the y axis.
Would this method work? Or do you guys have another suggestion for me?