I cannot wait to actually get some form of functionality going. Moving on I’m presented with something called MonoBehaviour and that we need to break inheritance from it. This is done as a declaration within the C# script – coding time!

Very fancy, VS knew what I was after before I did.

According to the book, this means that I can assign values to the objects from the Inspector. Apparently we need to do it to the weapons class too.

Next is the usage of fields – handy little buggers that can hold information for us within a class. We all know our snake needs some stats, right?

Nice! That’s our blueprints sorted out then. From here our kitted out snake can have all sorts of armour and weapons made, so lets do that using the MonoBehaviour Database.

Using the System.Serializable affords the ability to modify the fields directly. I’m thinking helmet.defence = 1mil personally, them apples can be pretty damaging. Now I can check them out in the Unity Engine.

Method testing up next, that means another new GameObject and script and connecting them.

I know, I scare myself with my creativity and ability to logically put sentences together. Lets tidy it up a bit and add a bit more functionality.

Now its legible and actually useful! The book now goes off about what kind of game we will create. It will be a mouse-click interaction game with rigid bodies , a collision system and a UI. I’m going to stick with my basic snake game but I’ll do this work first as a proof of concept too – give me the basics. I do feel the overwhelming urge to just jump straight in and attempt to do Snake, but for once I’ll curb that and go with the book and call this particular element clicker.

Leave a comment

Design a site like this with WordPress.com
Get started