I'm trying to make a camera that is similar to Metroid / Megaman X, and other platformers.
Basically, the camera follows the player through the level, but there are boundaries that keep the camera from going "off track" (too far past the floor or ceiling or wall, revealing empty parts of the level)
The camera I've made almost achieves this, but I'm having a few problems with it; mainly when switching from a horizontal path to a vertical path. I've made a video demonstrating my current camera and it's issues. I also uploaded the code.
So yeah, I'd like to know if I'm even doing this right, and if so, how to fix the bugs. If not, could someone lend a hand? Any help would be great. I've been trying to figure this out for OVER A YEAR, compensating with crappy cameras in various games of mine. Thanks
Well thanks for trying, every bit counts. The camera in your example is exactly what I'm going for.
But seriously, I will compensate for anyone that can help me figure this out. Whether it be helping with your game or giving full credit or what have you. I've started on so many games that were never realized simply because I couldn't get this type of camera system going; It's a necessity. Thanks again
While the camera is following the player, it's movement will be jerky as it tries to be in two places at once. So, don't have the camera follow the player. Make the camera a separate object from the player, and just have it mimic the player's movements while colliding solely with the boundaries. If your screen size is 320x240, then make the camera a rectangle, sized 320x240. You'd also be able to reduce the number of boundaries you use.