Unity -2D Spaceship Game

7 November 2016

Following on from last lesson we have begun to introduce vectors and speed instructions to the spaceship game. Before we did however, I was introduced to Data Types. Now pretty much everything with Unity I’ve never heard of before and I’m going in to all of this with knowledge equaling zero, and I’m not afraid or ashamed to admit I pretty much went, “uh?” So while most of the class is skipping ahead or having an idea of bits and pieces already I’m still sitting there thinking “what now?” Nevertheless I soldiered on in hope that something sink in and I’ll get to hang of it…practice makes perfect and all that.

So to start with, game design is all about the manipulation of information, even before development begins. Apparently its all a numbers game. These numbers boil down to four main types; String, Integen, Floating Point and Boolean. A String is a line of numbers, 12345; an Integen is a single number, 1 or 0; Float is a number with a decimal point, 3.14 and a Boolean is a data type with only two possible values, yes or no, true or false. These four are known as built in types, or primitive types and are built into C# inside of Untiy as standard (and to make coding easier).

After the introduction to these we continued on from last week with the spaceship game. We experimented with creating our own variable code which we could apply to our scene if we so wished but the code didn’t do anything, it was more so we could have a try ourselves to begin to understand it better. I did create a code for it but for the life of me I can’t find it at this present moment, (computer problems) so I’ll try and add it at a later date.

Next we added a piece of code to the spaceship to make it move when directional buttons were pressed. At first we instructed the code to move the ship without telling it how much thrust to give, this resulted in the spaceship hitting warp speed and hurtling off the side of the screen never to return. We altered the code (as above) to have the ship move around the screen and accelerate in real time to how long the button was held down. This resulted in a much more controlled movement which your eyes could follow and could control the direction of the ship easily.

It’s moving, I promise you.

Not long after this we finished the lesson and moved to begin ideas and/or continue work on either the Christmas game or our walking simulator. I chose to do the latter since I’m finally starting to get to grips with it as I feel like I’m miles behind. Unfortunately I have no screenshots of said simulator as previously mentioned, I’m having some PC issues at present. When they’re sorted I’ll update the post with some screens.

Search

Search for:

Text Widget

This is a text widget, which allows you to add text or HTML to your sidebar. You can use them to display text, links, images, HTML, or a combination of these. Edit them in the Widget section of the Customizer.