Get started

Welcome to Interphase's dedicated tutorial on getting you started with making games. Don't worry if you've never programmed before or even know what programming means. If you don't, then you're in the right place.

What is coding?

If you want to start how to make a game, you will need to learn how to code. Coding refers to writing a series of instructions into a file, that when run, instruct the computer to do something. You will soon realise that the ability to write coherent code is immensely powerful.

Now that you know what coding means, it is time to see some code. Lo and behold a hello world program!

              
                print("Hello world!") 
              
            

This code is written into a special file that ends in ".py". To run this program you have to go to a program called the terminal (or command prompt in Windows). If you run it through this program, it will say "Hello world!".

Choosing a way to write your code

We believe that one of the first things you should think about is what text editor you use. This is what you will use to write your code. This matters because a good text editor will improve your workflow, and will ultimately make you a better programmer. We have made some recommendations for text editors below, with a brief description of what they're good for and not so good for.

Editors Pros Cons
VS Code Highly customisable & provides source control tools A little complicated for beginners
Atom Offers the best integration with GitHub & a modern design Large install size & runs slower with many plugins
Sublime Text Sleek and simple, has a distraction free writing mode & optimised for speed of execution Lacks the same variety of plugins as VS Code and Atom

You will find that any three of these text editors will offer you an enjoyable coding experience. Our personal recommendation would be to perhaps start with a lighter editor such as Sublime Text, and once you feel more comfortable, perhaps move on to using an editor like VS Code (our personal favourite, and what we used to write this website).

What even are programming languages?

All of the above is good and well, but you've probably heard of the term "programming languages" before and wondered what that means.

These are in fact quite intuitively named - they're languages in the sense that they are used for us to communicate with computers. You may be surprised to hear that computers don't actually understand the code that you write. This needs to be translated first into another language that they do understand.

Your first program

Now we will help you code your first program and explain you what it does. It will be much easier for you if you write the code in a compiler and test it by yourself.

Firstly we will make a program that will ask for your name and then display it:

              
                print("Welcome to your first program.")
                name = input("What is your name? ")
                print("Hi " + name + ". Welcome!")
              
            

The program contains 3 lines. The first one will show on the terminal the phrase between the quotations marks, using the print command.

Then we declare a variable called "name", which will remember the name that the user will type in the terminal given the prompt in the quotations, using the input command.

Lastly we use the print command and we concatenate (combine) the strings using the "+" symbols.

Now we will show you how to change a string to an integer.

              
                age = input("How old are you? ")
                newage = int(age) + 5
                print("You will be " + str(newage) + " in 5 years!")
              
            

In the variable "age", the user's input is stores as something called a string. We have then declared a new variable named "newage". We are first converting age into an integer (whole number) using int(), and then adding 5 to that value. Now, the "+" will not be used for concatenation, but for doing the sum. Finally, we will use the str() command to convert new age back to a string so we concatenate it. The program will now output what you expect, telling the user they will be 5 years older in 5 years!

Building your first game

In the previous part we showed you the first commands that any programmer will learn when it will start coding. Of course, your adventure just started and we hope you will enjoy it. We recommend you go to W3Schools Python and learn about all of the commands that Python has to offer.

We attached a video made by Kite in which he will show you how to code a Hangman game in Python. Enjoy!