C# game coding tutorials
C# game coding level 1
This set of C# coding tutorials is for you if you are completely new to programming or the C# language. You will learn all you need to know to code C# games as quickly as possible. You could be tinkering with your own game projects within a few hours.
There are plenty of game-related mini-projects in […]
Game variables in C#
When we code a game in C#, whether with Unity or any other tool, we need to ‘know’ what the situation in the game is. As an example, things like how many lives the player has, how many people connected to game-lobbies, where in the game level all the players and enemies are, etc. The […]
Making use of variables in C#
Having just learnt what C# game variables are and that they store values that represent the data in our games, it is probably obvious that these values held by our variables will need to be changed as the game is played. For this we need C# operators. Operators in C# are just like mathematical operators we used in […]
Conditions and decisions
Condition checking in games is all about making decisions. How do we “know” if the player has completed the level or crashed a ship? How do we detect if the ball has reached the edge of the screen and needs to bounce back the other way? C# has the keyword which helps us detect […]
Loops in C#
Loops are how we repeat the same part of the code more than once. This can simply mean doing the same thing until the code being looped over prompts the loop to end or it could be a predetermined number of times as specified by the loop code itself.
We will look at two […]
Structuring C# games with methods
C# Methods allow us to organize and our code into named, logical, sections. As our C#/Unity game projects become more and more advanced with exciting features and deep systems, methods will be one of the constructs that make it possible. We have already seen the Unity method in the Unity & C# part 1 […]
Object oriented programming with C#
Object Oriented Programming, or OOP for short, is the way almost all programming is done, in almost all languages. It hasn’t been this way forever and there are some exceptions but if you want to make games, it’s a topic that needs to be learned. OOP is designed to help us write code for games […]
Handling data with C# arrays
All these objects, variables and types are useful but what happens when we have hundreds or thousands of them? How can we possibly keep track? C# arrays are the solution and in this 5-minute tutorial, we will see the simple way that we can organize objects and variables into arrays. Then we will waste no […]