Close

How I Created My First Game: Programming Languages vs Scripting Languages

henrywilliams8861henry.williams8861 wrote 04/17/2020 at 08:54 • 7 min read • Like

My name is Henry Williams, and I started programming about 10 years ago. I always loved playing video games, even from a young age. That passion eventually turned into something much more. Learning programming languages is very popular at the moment. A lot of people leave their current workplaces to learn how to create websites, programs, games, etc. The reason for that is how high-paying this industry has become. On top of that, it’s an activity that you will enjoy. They say that if you love what you do, you won’t have to work a day in your life. That’s exactly how I feel when it comes to programming and creating games.

When I started this venture, game development was on a rise. However, I never imagined that it would become so popular in such a short time. E-gaming is taking over the world at the moment. There are professional gamers that earn more than some athletes. Nevertheless, they wouldn’t be able to do that without game developers and programmers. Game development was affected the most by technological advancements. Things that were once deemed impossible are now part of everyday life. Advancements allowed a lot of independent game developers to appear on the market. Most of them already have several success stories behind them.

The Unity game engine, which appeared back in 2005, is being used to maximum. The free version of this engine gives everyone a chance to try game development. It’s completely customizable, so programmers can have hours of fun with it. Having fun with Unity can lead to creation of something highly successful. Nevertheless, let’s take a step back and get back to the beginning. All of this started because of programming and scripting languages. Below, I will explain the difference between the two and also share some thoughts on them.

Programming Languages

To create a website or create a code for an app or some game, there are three types of languages that are involved in process. They are known as programming, scripting, and markup. We are going to start with the programming ones as they are the base for all codes.

Programming languages are a group of codes that give computers a certain task. The code is instructions about what computer should do. To make it simple, it’s like you asking your computer to do a task, and you give him instructions on how to do it. The idea is to get what you wanted, but it all has to be done correctly. For instance, let’s say you want to install a game on your computer. The game will have installation software that handles this. You set preferences, and software orders computer to install the game under those preferences. How it works is very simple, but writing the code is not easy at all.

Any programming entity you use is part of a group known as high-level languages. Computers don’t understand them. Computers understand only binary codes (0 and 1). Binary is a machine-level language, so any programing language needs to be translated into binary before computer can understand it. This is how the process usually looks like. Instructions are written in a form that we can understand. Then we use a compiler to translate what’s written into binary. Compiler finds errors in the code and throws them up. Person needs to fix those errors, or the code won’t work properly. Here are some examples:

As we mentioned above, programming languages are the basis of all coding. That’s why they are mostly used for creating drivers and software. This involves anything from building mobile apps and video games to creating server-side applications.

Scripting Languages

These languages can be considered a continuation on what we mentioned above. The name already explains enough. A scripting language means that a script needs to be written for some task to be performed. We use them to control and guide other programs. So, a script also works by giving instructions. However, unlike programming languages, the scripting ones can’t work as standalone. They need a parent program to back them up.

For that reason, a compiler can’t be used when working with a scripting language. It needs an interpretation, which means the code needs to be scanned one line at a time. You need to lay groundwork through a programming language, and then the scripting one will take over. Here are some examples:

They are used for creating all kinds of websites.

My First Game

Before I talk about my first game, I would like to make sure that you understand the difference between programming and scripting language. A lot of people use these terms as synonyms, which is wrong. We can say that all scripting languages are programming as well. However, all programming languages are not scripting ones. The need for former ones came first. They were used to build the most basic products. For instance, Microsoft apps like Word and Excel, Internet Explorer, etc. With time, extra functionalities were required. For that to happen, programming languages had to be enhanced. That’s how scripting ones were created.

The main difference between the two is that a scripting language doesn’t use a compiler to check code while programing one need compiler to turn the code into machine language. Scripting languages need an interpreter to do the same thing. This means that code is checked line by line. Another major difference is that all programming languages run independently. Contrary to that, a scripting one has to be interpreted within another program. For example, JavaScript has to become a part of HTML before it’s interpreted by a browser. A programming language is always standalone, while scripting needs a parent program.

Last but not least, we have to mention one more thing. Both types of languages were created to help with software development. A programming one is used to directly code and create software. On the other hand, a scripting one is used to improve that coding and make it simpler. To get the maximum out of software development, both languages have to be used.

Now that we are clear on the languages let me tell you how I created my first game. It was more than 5 years ago when I first decided to learn Java coding. I wanted to test my progress so I used Java programming to create a slot game. It was a very simple game which was working well on my phone. The slot had three reels with just one line. Below, there was a spin button. The gameplay was beyond simple, getting two matched symbols led to a smaller win, while 3 matched symbols gave the biggest win.

First I picked the images (symbols) that I wanted to use. This was the code:

String[] symbols={"Seven","Shamrock","Diamond","3Bar","Star","Bell", "Bar","Orange","Lemon"}; //slot symbols

Then I worked on the winning combination and how much money player can win. There were different amounts for two and three matched symbols.

//amount winning

int[] twoMatches={30,16,15,12,11,10,9,7,5};

int[] threeMatches={60,32,30,24,22,20,18,14,10};

When that was done all I needed was a code that will randomly choose one of the symbols and put it on the reels. The first code I used was more basic and I would say wrong; however, the second one worked much better.

// a random from 0 to 9

int randomInt = (int) System.currentTimeMillis() ###b#< 10;

 double random=Math.random();

random*=8;

int choice=(int) random;

After that, all I needed was a good UI. However, I didn’t bother too much with it because the design is not my strong suit. I was happy that the game worked, and that was the most important thing.

As I mentioned above, the game was created in Java. This is probably the simplest programing language that exists. It’s easy to learn, understand, and implement. Java is designed in a way that makes the language need the least number of dependencies. You will notice that a lot of people say how Java is object-oriented. According to a 2019 report, Java was the most popular programming language in the world. Its main use is client-server web applications as Java has almost 10 million developers. The reason for this is because Java is much simpler than C or C++. It’s also divided into categories.

The simple slot I created made me think about slots game in comparison to others. Modern video slots and video games have the same background when it comes to creating them as on the photo below, there you can see Queen of the Nile Pokie. It takes the same amount of planning, detailing, and coding. Slots are simpler and need fewer resources to make. However, both require a lot of attention to detail. Regular slots, on the other hand, are much simpler. Everything in them is straightforward. Classic slot-machines work exactly like the online slot game I made. There are just three rows and one active payline. The only way to win is if you get two or three matched symbols on that payline.

Like

Discussions

jeremy.smith3567 wrote 05/04/2020 at 20:15 point

So you are telling that the game was created in Java. No way! It is imposible to create reels there. 

Python is much better for that!!! Moreover codding with Python will safe your time!!!! 

  Are you sure? yes | no

henry.williams8861 wrote 05/04/2020 at 20:18 point

Thank you for reading my article. It is possible and will take not so much time. Here the link to my friend`s youtube with step-by-step guide - https://www.youtube.com/watch?v=1MmjWGnhnaI

Cheers

  Are you sure? yes | no

jeremy.smith3567 wrote 05/04/2020 at 20:19 point

Still, PYTHON IS BETTER!!!!

  Are you sure? yes | no