Why do 2D games have main character locked in the middle of the screen

Started by
13 comments, last by SeraphLance 10 years, 4 months ago

There is something weird about two buttons. Why does the game have up key makes ship go down and down key makes go up?

You are correct. I believe it's a personal matter like being left-handed or right-handed.

Some people prefer controlling aircraft in games with the reverse vertical controls (makes it feel more like a real control stick, and should work better with analog-sticks in gamepads). Others prefer the normal version.

I chose reversed since it's a simple demo, but the professional way is to let the user decide what he wants.

Advertisement

In many 2D platformers such as Super Mario Bros., the camera is actually locked to a predefined vertical height and will only move horizontally with the player, keeping him roughly in the centre of the screen only on the X-axis. In this setup, the main character is not necessarily in the middle of the screen. The camera does not move up with the player as he jumps or even when he moves to higher platforms. It's even possible to jump above the top of the screen so the character is no longer in view. The basic principle behind this method is that the camera should move as little as possible and only when it needs to. Jumping is a quick motion and would cause the screen to be very jerky if it were locked to the player's position. Many later platformers such as Super Mario Bros. 3 used a hybrid system in which the camera would lock to varying vertical heights defined throughout a level but could enter a "free mode" if the player happened to move too far in one direction up or down or where in places there is no defined vertical height to lock to. In this "free mode" the camera more or less keeps the player in the centre of the screen.

There is something weird about two buttons. Why does the game have up key makes ship go down and down key makes go up?

Because that is how a joystick on every real life aircraft works.

if they did it right, the camera could actually show more ahead than behind, simply so you have more time to see what is coming as you move.

Intrusion 2 does a great job at this:

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

There is something weird about two buttons. Why does the game have up key makes ship go down and down key makes go up?

You are correct. I believe it's a personal matter like being left-handed or right-handed.

Some people prefer controlling aircraft in games with the reverse vertical controls (makes it feel more like a real control stick, and should work better with analog-sticks in gamepads). Others prefer the normal version.

I chose reversed since it's a simple demo, but the professional way is to let the user decide what he wants.

Ah that's a neat fact! I never knew that aircraft joystick were like that

Some games have the camera move when the player exits a bounding box, but where the box is substantially smaller than the viewport. This can sometimes make things look a little more fluid. I personally prefer this approach, especially for top-down 2D games. It's substantially more work on the coding side though (still not that hard, really).

This topic is closed to new replies.

Advertisement