I Wanted to Learn C#
So I Made a Game with Unity
The game can be downloaded here:
After learning and working in Python to create small scripts I needed in Modo, I felt a desire to get even further into programming. I want to continue to develop tools in Modo, but I also thought of some ideas for tools for working in the Unity 3D editor.
The learning curve when I first stepped into C# wasn’t quite so steep thanks to some experience I gained working in Python. The languages aren’t the same, but the concepts of declaring variables, creating methods, communicating between scripts and more, were already familiar to me.
And although my initial interest with programming in Unity was primarily to create tools for working in the engine’s Editor, I found it a bit difficult to find documentation and tutorials surrounding this subject. Almost all the focus from the community is devoted to gameplay programming. But this is also an exciting direction, so I decided to buy a tutorial on Udemy to follow along and make a small game with. It was a very well made tutorial, by Jonathan Weinberger.
I took a little bit of a departure from the assigned curriculum: The tutorial was instructed in 2D and used only assets that Jonathan provided. However, I wanted to make a 3D game, and although I am a skilled game artist, I didn’t want to spend the time making assets for a simple experimental foray into programming. So I used the assets that Unity provides with the engine for the same type of game (Arcade Shooter), and I added in some of Jonathan’s sprites and audio where I needed them.
The decision to go 3D created a few unique challenges that I had to figure out on my own, such as the ship’s left to right rotation animation and limiting those rotations, which one wouldn’t need to do when strictly following the 2D instruction in the tutorial. Discovering the difference between standard transform.rotation and the Quaternion rotations, and converting back and forth between them, was quite enlightening!
But Jonathan’s instruction method of challenging the student to pause the video and, on their own, create solutions to problems presented to them based on previously illustrated lessons, was effective and rewarding. I sometimes found myself approaching things differently than the way he would, such as when I decided to assign a damage amount to the laser beam. Jonathan ended up opting for a simple instant destruction of the enemy upon collision with the laser. I wanted the option of changing health amounts on the enemy entity and/or the damage amount on the laser later on, so I set it up so I wouldn’t have to re-write code later on.
Above all, I felt I gained a great understanding of how C# works in Unity, as well as a better understanding of high-level programming in general. I’m excited to take these new skills to continue toward developing my own tools in Unity. I’ve already begun work on a Unity extension that I can hopefully include in the Environment Pack I’m building.
But more on that later!!