Chapter 01. 2D Twin-stick Shooter

The shoot 'em up genre of games is one of the earliest kinds of game. In a shoot 'em up, the player character is a single entity fighting a large number of enemies. They are typically played using a top-down or side-scrolling perspective, which is perfect for 2D games. Shoot 'em up games also exist within many other categories, based upon their design elements.

Elements of a shoot 'em up were first seen in the 1961 Spacewar! game. However, the concept wasn't popularized until 1978 with Space Invaders. The genre was quite popular throughout the 1980s and 1990s and went in many different directions, including bullet hell games, such as the titles of the Touhou Project. The genre has gone through a resurgence in recent years with games such as Bizarre Creations' Geometry Wars: Retro Evolved, which is more popularly known as a twin-stick shooter.

Project overview

Over the course of this chapter, we will be creating a 2D multidirectional shooter game similar to Geometry Wars.

In this game, the player controls a ship. This ship can move around the screen using the keyboard and shoot projectiles in the direction that the mouse is pointing. Enemies and obstacles will spawn toward the player, and the player will avoid/shoot them. This chapter will also serve as a refresher for a lot of the concepts of working in Unity and give an overview of the native 2D tools in Unity.

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:

  • Setting up the project
  • Creating our scene
  • Adding player movement
  • Adding shooting functionality
  • Creating enemies
  • Adding GameController to spawn enemy waves
  • Particle systems
  • Adding audio
  • Adding points, score, and wave numbers
  • Publishing the game

Prerequisites

Before we start, we will need to get the latest Unity version, which you can always get by going to http://unity3d.com/unity/download/ and downloading it there:

Prerequisites

From here, you'll want to select the Choose your Unity + Download button and from the following menu select the edition of Unity you'd like to use and then download the Launcher.

Everything that we will be covering will work in the Personal Edition, unless I mention specifically otherwise. At the time of writing, the latest version is 5.3.4, but the project should work with minimal changes in future versions.

We will also need some graphical assets for use in our project. These can be downloaded from the example code provided for this book on Packt Publishing's website (http://www.PacktPub.com).

Navigate to the preceding URL, download the Chapter1.zip package, and unzip it. Inside the Chapter1 folder, there are a number of things, including an Art Assets folder, which will have the art, sound, and font files you'll need for the project as well as the Twinstick Shooter folder which contains the finished project for you to take a look at.

..................Content has been hidden....................

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