I've been working on a simple 2D platformer engine. So far I've got a sprite moving around (not yet animated), and 3 platforms for a "Jetpac" type game (old ZX Spectrum game - I'm sure if you google it you can play it in a flash box).
Now I'm onto the problem of implementing collision detection so the sprite can actually walk on the platforms. I think this will be the biggest job and then it's quite easy to continue. But how to implement collision detection with platforms?!
I have bounding boxes for all platforms, as well as the character, and later on there will be bounding boxes for enemy sprites, but that can be handled later. Basically, what is the easiest way to allow a sprite to walk on a platform, and not go through it using Bounding Box?
A bit more information:
- Character class controls drawing the sprite and updating the sprite using a Vector2 position variable, updated with a Vector2 motion variable.
- A Platform class controls the drawing of the platforms (there are 3), so plat1, plat2 and plat3 are all types of Platform.
- The platforms need to be fully solid on all sides, but allow the sprite to walk on.
Any help?