With some of the tools I’ve built for XNA, I’ve been prototyping a simple 2D platformer last month. It’s pretty basic so far, very much inspired by Super Mario World, with the character being a combination of Sonic’s Tails and Yoshi’s movement-style.

I’ve been studying frame-by-frame how the camera in Super Mario World works, there is an area of “dead space” in the center of the screen where the player can freely move without the camera following, but once you hit the edge of that area, the camera starts moving horizontally on the X-axis to keep up.

XNA Platformer

Once you look in another direction, the area shifts to the opposite side. This is a really clever way to give the player more visibility in the direction they’re moving, without having the camera constantly following every small movement, or simply centering the camera on the player at all times.

XNA Platformer

However, vertical camera movement is still jarring. I’ve limiting changing the Y-axis camera position only until the player has jumped and landed on a platform of different height. This prevents the camera from bouncing up and down with every jump.

AABB AABB (axis-aligned bounding box) detecting slope tile collisions.

The biggest obstacle so far has been the collision system. I’ve written my own AABB (axis-aligned bounding box) system, but it’s been a struggle to get it working right because of slopes and moving platforms. It’s been a lot of trial and error, but I’m getting there.

AABB Collision detection with moving platforms.

There are 4 levels so far, thanks to my XNA level editor, which has been a huge help in quickly getting levels designed and implemented. I’m still prototyping the core mechanics, but once those are solid, I can start building out more levels and content.