Mommy's Best Games, Inc. is an independent game developer founded in 2007. This is a view behind the scenes of our game development and marketing!

Nathan

Thursday, November 14, 2024

How I Fixed the Camera in My 2D Platformer

 I've been working on ChainStaff since 2019! 

And while I finished Bumpy Grumpy and a few contract jobs in between, it's been a lot of good iteration and learning along the way to make a better platformer. 

One of the most important parts of a platformer for me is a good camera! And for me a good camera is one that you don't even notice. Check out my recent video here about how the camera works in ChainStaff


If you'd rather read than watch, then please read on!

Vistas

There a several special things I'm trying to do with the camera in ChainStaff. One of them is to create exciting fights and beautiful moments. 

Each level opens with a gorgeous vista of the new level. 

Level 4: Moss Islands

You get to soak it all in, the alien world, blowing leaves, lighting, nasty clouds, and creepy tongues swaying in the wind. Then when the player starts moving the camera picks up and starts following you. 

Another special camera I use is to have a vista combined with a big fight. The opening of level 2, the Dragon's Bridge has you launch straight into an epic battle with the Jet Dragon on a thin rock bridge. As you get closer to the dragon, the camera zooms into the action. If you run away, the camera backs up to capture you and the dragon in view. I like this a lot, but it's a bit unusual for 2D action games to pull back quite this far. I carefully designed several fights in the game to take advantage of these huge views, while still remaining fun and fair. 

The Dragon's Bridge: Look how tiny you are!

Less Is More

For most of the action of the game, the direction I give the camera is "only move if necessary". 


Basically I follow the Miyamoto method developed as far back as Super Mario World

There's some great videos on how he designed the camera there. I use similar direction in ChainStaff. If you are jumping up, the camera only moves up with you, if you actually jump up to a new platform. If you are simply hopping up and down, I don't follow the player up and down. If you make the game like that, the camera is really spazzy and it's hard to see what platforms or enemies you're going to land on! It's much better to keep it still unless you land on new ground. 

Swing Town

One tricky area for ChainStaff is making something that works with the wildly swinging grappling hook. 

You are attached to a grappling hook, and swinging left and right fast. If I simply follow the player, it's very hard to play.

The direction I use instead for the camera is to follow the attached point of the grappling hook. This works because its in between of where the player wants to be. The player can swing left/right fast, and its easy to focus on the action. As soon as they let go, the camera smoothly transitions to then following the player again. 

These are the three main areas and methods I use to make for a smooth camera experience for the platforming and shooting action in ChainStaff. Check out the video for more details, but also check and see how Miyamoto did it for Super Mario World. As usual, he's a master!

Thanks for reading and please wishlist ChainStaff, thank you!.