Setting Up a 2D Shmup in Unity

David Hunter Thornton
3 min readJul 31, 2022

--

How do I create an old school “shoot ’em up” in Unity?

Objective: Show all of the initial steps to make a vertical scrolling “shmup” with Unity and Visual Studio.

Now that we have everything the way we like it in Unity Editor, its time to actually start with some coding and setup. The first thing that you should do is start with a fresh scene. So delete any existing scenes or assets left over from the walkthrough in the last article. Then let’s create a new scene and name it “Game”. I’ve also switched to 2D View for this article. (Top right of the Scene View is a “2D” button.)

Now that everything is ready to rock ’n’ roll let’s change our Game View from “Free Aspect” to “16:9”. In Free Aspect it changes the shape of the screen to fit whatever monitor you’re currently viewing on. This is fine in some cases, but typically you’ll want to us a standard HD screen size.

Now, there’s one more thing before we can actually dive into some code. We need to create a new folder for our “Scripts” inside our “Assets” folder. And then we’re going to make a Script for our code. Be very careful when creating new Scripts because you need to name it immediately. If you don’t, you’ll run into errors and have to fix it later. To show you what I mean, I’ll show you the right way first, and then I’ll show you the wrong way.

As you can see, the class never changed in the code to the new name. You’d have to go in manually and fix it.

Now, we need to attach our CharacterController Script to the actual Player Character. For now we’ll just add in a 2D Square and that will work as a placeholder (or primitive).

And to maintain proper naming techniques and organizational methods let’s be sure to rename it as “Player”. Additionally, the “Sprite Renderer” functions very similarly to the “Mesh Renderer” that we talked about in another article in regards to materials. So if you’d like to change the color of our Player, You can do that as well.

Now the last thing I’d like to do before diving into the code is to change the background color. The blue is perfectly fine, but I think I’d like to make mine either black or a dark green to contrast with the blue I chose. To do that select the “Main Camera” in your Hierarchy.

From here there’s two settings to adjust. First “Skybox” is really only relevant for 3D games, so for tidiness sake we’ll change that to “Solid Color”. And directly underneath that you can change the color to something more suitable as a placeholder for your project.

My next article is going to focus on getting our hands dirty with some coding. Till next time!

--

--