Adding Depth to Flatland
The programming for the previous prototype is in the bag, and now it’s time to start thinking of the next challenge. For this series I’ll be working on a 2.5D game in Unity. This has all the perks of looking like a 3D game, but with one fewer axis of movement to worry about.
I’ll be using this opportunity to focus on learning some new aspects of the Unity Editor, including the physics-based character controller. And I’ll track most of that activity here, so you can follow along and try some of these things yourself. There will be double jumping, platform moving, wall jumping, ledge grabbing, puzzles… All that exciting stuff and more.
But let’s not get ahead of ourselves.
New project time. That little blue Create button is ready to be clicked. Now, my previous 2D game (play Galaxy Blaster!) started with the 3D template too, so this isn’t anything new. The Unity Editor seamlessly switches between 2D and 3D modes, and it’s pretty trivial to convert one to another along the way. This time, though, we’ll be adding 3D assets to our 2.5D prototype once it is ready for them.
But first, we work with primitives!
We’ll start with two 3D objects, a cube and a sphere. The cube (elongated to a rectilinear solid) will represent our platform, and the sphere a collectable. While we are building with 3D primitives, we don’t really want to have to think about the Z axis. So make sure you’re working in 2D mode, and zero our the Z of our objects. This will make everything easier.
Now, let’s copy and paste our objects into a ruidmentary level for testing.
And finally, we add a capsule to the scene to represent the player.
Okay, the stage is set. In the next article I’ll start working on programming the movement with the Character Controller component.