Chapter 6. Side-scrolling Platformer

At this point, we've gotten a chance to work on a number of games, but we've only been using 2D so far. In this chapter, we will be exploring how we can use the concepts that you've learned in 2D and use them with a 3D game with 2D gameplay.

As long as we have been playing games, there has been one particular genre that has stayed with us almost from the beginning, the platformer. Starting with Donkey Kong with the familiar content that we know, refined in Super Mario Brothers, given more action with Mega Man, taken faster with Sonic the Hedgehog, and used even today with games such as Terraria, Super Meat Boy, and Child of Light There is something that draws us to this specific type of game, especially within the indie game community.

A platform game (known commonly as a platformer) consists of a player controlling a character that can move around a game environment with extensive jumping between platforms, hence the name.

Project overview

Over the course of this chapter, we will be creating a complete side-scrolling platformer project. You will learn the similarities between working in 2D and 3D and the differences, in particular when it comes to physics.

Your objectives

This project will be split into a number of tasks. It will be a simple step-by-step process from beginning to end. Here is the outline of our tasks:

  • Tile-based level creation
  • Adding player functionality
  • Adding collectibles/power-ups
  • Designing the level layout and background

Prerequisites

As in previous chapters, you will need Unity installed on your computer, but we will be starting a new project from scratch.

This chapter uses no graphical assets; however, the completed project and source files can be downloaded from the example code provided for this book on Packt's website.

Project setup

At this point, I have assumed that you have a fresh installation of Unity and have started it up:

  1. With Unity started, go to File | New Project. Select a Project Location of your choice somewhere on your hard drive and ensure that you have 3D selected (Note this is different than previous chapters). Once completed, select Create project:
    Project setup
  2. At this point, we will not need to import any packages as we'll be making everything from scratch. From there, if you see the Welcome to Unity popup, feel free to close it out as we won't be using it.
  3. Create the following folders just as we described in the previous chapters:
    • Prefabs
    • Scenes
    • Scripts
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset