Collision is simple, assuming that your characters are rectangles here is a sample of my old code
Collision
detection is simple (for simple shapes, anyway); it's collision
response that's the hard part.
For platform games, this depends on the type of objects that collided.
The simplest case is, of course, a bullet. A colliding bullet simply disappears and causes damage to whatever it collided with.
Enemy vs. player collisions are more complicated, since unless the player is a one hit-point wonder, both objects will still be around and still be intersecting unless you do something about it. Depending on the game, you may or may not want enemies to be solid (see below), and in either case, if the collision itself causes damage (as opposed to the more realistic case of requiring one actor to actually perform an attack in order to damage the other), then you need knockback and/or mercy invincibility to avoid repeating the damage on every frame.
Finally comes the platforms themselves (as well as anything else that functions as a solid platform). Here, it's important to know which direction the collision came from (whether you walked into a wall, bumped your head on the ceiling, or are standing on the floor). For
square actors, this can be accomplished by checking which axis (X or Y) has the greatest absolute difference between the distance and the sum of the sizes of the actors (ie, how deeply they're interpenetrating) (for rectangular actors, you also need to take into account the actors' aspect ratio). The sign of the difference tells you the direction. Then it's just a simple matter for zeroing the moving actor's velocity in that axis, and clipping its position to the plane of the platform. For the special case of collisions from above (standing on the floor), you also want to set a flag saying that the actor is standing on a floor, so you can set appropriate animation, etc.
Note that all of the above only applies if no object can move fast enough to reach the other side of another within a single frame (mostly a problem for bullets, but can affect falling players if they have no terminal velocity). In that case, it gets even more complicated.