Learning Unity 2D
by re-creating Mega Man
Category: Uncategorized
-
Today, I fleshed out “stages” more, and enabled the ability to have random encounters (from a fixed set). Additionally, I added a new enemy: a blue chopper which fires 3 bullets in rapid succession, instead of just 1 at a time. I’m not really going to get into the details about it since it’s a…
-
I swear I got hit on purpose. Bug Fixes Firing too much! While testing, I discovered more bullets were firing from Mega Man’s gun than should be. If I mashed the fire button quickly 5 times, several more than 5 bullets would come out. The problem was that in my weapon controller, the coroutine responsible…
-
Progress! And yes, I am tracking his health. Each bullet has a damage to it. And he also gets hit if he runs into an ememy. Niiiice. Coroutines I was introduced to a new concept in Unity called a coroutine. Java (my native language) doesn’t really have anything super analogous; typically, I’d just spawn a…
-
Progress I think I’ll just always post a gif of my latest progress with each post, highlighting the new stuff. Refactoring Before I begin, I wanted to do some refactoring. Use a little bit of my knowledge of OOP to prepare for the future. The bullet object I made before was very specific; if I…
-
To shoot backwards, there really only seems to be three things I have to do: I thought I might have to adjust the position of the gun object, but since that’s a child of Mega Man, so long as we flip him, the gun flips as well. Nice. After some searching, I discovered the lovely…
-
No longer is Mega Man flying through the void: Very cool. I looked for a lot of solutions to this online, and it seems everyone did it differently. Some folks used actual 3D objects (Quad?), and others used various strategies to repeat the background. It seems like the 2D technique that fits best is to…
-
Movement Cleanup Earlier, I put a PlayerInput component on both Rush and Mega Man. While they used the same script, so moved in tandem, it felt odd that technically they moved independently. Could I move the PlayerInput to the parent object instead? The answer ended up being “yes,” by utilizing transform.parent to reference the parent’s…
-
Animation First, let’s get this out of the way: I adjusted the Mega Man sprite to be Mega Man riding Rush. We’re adjusting things so this is a Mega Man shoot ’em up. Simpler, and more closely aligned with what I want my first project to be. So, I created a new game object that…
-
Well, before I can re-create Mega Man, I need some sprites. Some searching led me to this site, which has sprites for almost every game in the series! Very cool. However, the resolution is teeny tiny, made for the NES. While I installed GIMP, I was curious if there were any superior pixel art re-sizing…
-
The most recommended starting point to getting familiar with Unity seemed to be the Unity Essentials tutorial from Unity. So, over the course of the next few days, I went through the tutorials. Several were in 3D, which isn’t really relevant to a 2D project, but it still helped learn navigation around the editor and…