Hey all,
I just wanted to share a quick blurb on 2d platformers and their implementations. I think it is quite common to hear that the engines are hard to make. They really are not. At this point (as a programmer that is self taught) I have successfully created 4 different types. I started with XNA and C# and wrote my own collision algorithm for my first. I am going to outline the general ideas involved with each type and what I learned from the experience. Briefly, here they are... of course, the distinction between the types can be blury at times...
Raycast 2d platformer,
Physics based platformer,
Geometry based overlaps platformer,
Point based platformer.
RayCast Platformers
Platformers using raycasts are common these days. They are fairly straight forward to implement. They are nice because you don't neewd to worry about resolving collisions. Instead you make sure that objects that shouldn't overlap never overlap. You do this by shooting raycasts from the characters leading edge and look for upcoming collisions. You use the distance between the character and the upcoming collisions to determine how far you can move the character. You can use engines like box2d to provide raycast functionality or you can role your own engine. But why invent the wheel when you already have rockets. Dustforce is a notable game that uses this idea. Most game engines have raycasts built in (c2 is an exception, but it shouldn't be).
Physics based platformer
Most people think of games that actually involve physics and have a certain feeling such as limbo. But in reality, you can make a retro style game like megaman using physics without too many problems. You have to create a number of systems to detect where the character is (on ground, in air, etc). This is most easily achieved using raycasts, but overlapping geometry can also be used. Using constraints and applying forces such as friction yourself, and directly controlling velocity, you can pretty much make any retro style platformer. It doesn't take more work than rolling your own engine, it just requires an excellent working knowledge of how the physics engine actually works. Box2d is a fine choice. One of the top hits in google when searching for "platformer physics" is a popular blog that says you can't/shouldn't use physics to make a platformer. I can only conclude the author is either not accomplished at programming or lacks creative problem solving. An important note is that in construct 2 , there are many features missing from physics that makes it much harder to use to make a platformer without compromises (such as tripping on internal seams).
Geometry based overlaps platformer
Rather than preventing collisions, this style of platformer moves the character regardless of collisions, then attempts to resolve the collisions after the fact. The overlapping algorithms are fairly straightforward to implement if you have to roll your own, but figuring which direction to resolve the collisions is the tricky part. C2 has a great collision system that makes using this method feasible in c2.
Point based platformer.
Welcome to retro land! This is one of the simplest and easiest methods to implement and was the choice method for a decade. Mario and sonic used this method at one time. Essentially you make a character have points that represent its head, sides, and foot. If the points overlap solids then the point react in a specific way based on where it is. In mario 3, if his head overlaps a tile the game simply changes his upward velocity to 0. If a foot overlaps it pushes him up. You get the idea. The trick is all about where you put the points and this takes some time to figure out. You don't want the foot to be overlapping at the same time as a side on the same surface. In the case of mario 3, to handle slopes mario actually changes the position of his foot points to be more narrow. If you play a level that has slopes, mario's collision boundary is actually different than in levels without slopes.
All in all, regardless of the method used to make a platformer engine, adding slopes, ladders, oneways, moving platforms start to make it harder to make. Slopes in a raycast system or physics system are easier to add than in a point or overlap system.
The best place to start when trying to make a platformer is to actually google it and start learning. Simply adding the platformer behavior without understanding why it works makes it really hard to customize.
Cheers