Game Developer Guide For Beginner

In this tutorial, we going to look at how to start game development in C# and Unity. In this tutorial, we will learn the beginner level of the C # programming language, we will also examine the tools a game developer needs.

Contents Of The Guide

We will examine the concept of functions, simple output functions, Unity basic functions, variables, type conversion , and data types. If you have no knowledge of Unity, no problem, this tutorial will only focus on programming.

Function Logic In Programming

Let’s start by examining the concept of function, which is a term we will use a lot. Functions are blocks of code created to finish a specific task. Functions are usually in the form of the name(argument), which means the name of the function is written, then arguments are inserted in the brackets. Let’s pass to the output function.

Output Functions

Output functions are used to print data to the screen, it differs in Console and Unity projects, so we will examine it in two parts.

Console.WriteLine("Hello World"); // writes the given value and moves to the next line.
Console.Write("Hello World"); // writes the given value but don't pass to another row
Debug.Log("Hello World"); // Write the given value on the Unity console
Debug.LogEror("Error Message"); // You can create an error message with this function.

In the code blocks above, we saw 4 functions separately for both console applications and Unity applications. Let’s look at variables and simple data types.

Variables And Basic Data Types

Variables are called structures that hold data in them. By keeping integers, decimals, logic values ​​, and texts inside, they save the trouble of writing over and over again in the project.

In computer science and computer programming, the data type is an attribute of the data, which tells the compiler or interpreter how the programmer intends to use the data.

1 – Variables

int a = 1 // In integer data type, we keep the value 1 in variable a.
string b = "Hello" // In String data type, we keep the value Hello in variable b.
bool c = True // In Bool data type, we keep the value 1 (Ture) in variable c.
float d = 1.25 // In Float data type, we keep the value 1.25 in variable d.

2 – Data Types

int = Integer
float = Decimal
bool = Logic
string = Text
Type Conversions

We can convert the data types we saw above between each other (We can only change certain ones, not all).

// With bool, int structures can be converted.
// int structures can be converted to string structures.
// float and int can be converted between each other.

bool(variable) // Converts the value in the bool function to bool.
int(variable) // Convert the value in the int function to int.
str(variable) // Convert the value in the string function to str.
float(variable) // Convert the value in the float function to float.

Now, we going to look at the simple startup functions that come ready for Unity.

Basic Start Function In Unity

Unity has 5 special function, these functions are Start function, Update function, Awake, FixedUpdate and LateUpdate function. We going to learn these functions part by part.

1 – Start Function

Start function is running in when start game, important info, if your script is disabled start function is not running, I’m saying this in preparation for the awake function, which will cover in a moment.

private void Start()
   // Code is here

// Everything written into the start function will run once when the game starts.

// is for comment, so this statement is not running in program, just for give information. For now, we don’t need to focus on the structure of the function, we’ll just look at its logic.

2 – Update Function

Update function is runs until stop game. Update function is repeat start in every frame, if you don’t know frame, a frame is a digital data transmission unit in computer networking and telecommunication, and 1 second is equals 24 frame, so every 24 frame is actually is 1 second in computer.

private void Update()
   // Code is here
3 – Awake Function

The Awake and Start function is almost exactly the same, the only difference is that awake runs before start and the script works even if it is not active.

private void Awake()
   // Code is Here
4 – FixedUpdate Method

This method is mostly used for physics operations, while update is mostly used for inputs and other operations. The reason this method different  the update method is that it works with seconds, not frames. Each 0.002 second is run once.

private void FixedUpdate()
   //Code is here
5 – LateUpdate Function

The LateUpdate function starts when the other update functions have finished running, This function is mostly used in camera systems.

private void LateUpdate()
   // Code is here



4 thoughts on “Game Developer Guide For Beginner

  1. That is a really good tip particularly to those fresh to the blogosphere.
    Simple but very accurate information… Thank you for sharing this one.
    A must read article!

  2. Hurrah, that’s what I was looking for, what a information! existing here at this website, thanks admin of this web page.

  3. Your way of telling the whole thing in this post is truly pleasant, every one can easily be aware of it, Thanks a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *