How do you make a 2d game?
12 minute(s) read | Published on: Oct 11, 2021 Updated on: Dec 14, 2021 |
As you know, today, with the increase and advancement of technology, the number of designed games and homogenous gamers will also increase. The number of people who play games is increasing day by day, and that is why game designers and game developers must design games to have some attractive features in appearance and attract a lot of gamers and users.
Two-dimensional games and three-dimensional games are the games that attract the most attention today. Two-dimensional games have two dimensions in appearance, and gamers will feel two sizes when playing them. In contrast, 3D games are among the games that have three dimensions and have virtual reality when playing.
What to do to start designing and developing developed game games and applications?
1- Programming
The first step in designing and developing different game applications is knowing programming to process the production and development of games quickly. In addition to programming knowledge, you must have a little mastery of graphics and appearance design to design and develop a two-dimensional game easily. Also, programming languages can be used to design and develop games. We can mention Python.
2- Suitable game engine
After learning programming knowledge and learning, it is time to choose a suitable game. Some of the game engines are listed below:
- Unreal
- Game Maker
- Unity
- Godot
Game Maker
Game Maker Studio is a game engine for building a variety of 2D games, which is also cross-platform. Being a cross-platform game engine means that this engine can be used for some platforms and operating systems such as Mac, Windows, and Linux. This engine was created and built by YOYO Games.
Game Maker is a game engine that has all the tools we will need to design and develop the game and using this game engine, you can easily design and develop a game.
Game Engine Benefits:
- People who are new to programming and designing and developing games
can be a good option.
- The environment of this program is user-friendly and very simple.
- To work with vectors and design and develop games, you do not need specialized knowledge of mathematics and physics, and you can easily do the work with the tools in this engine.
The disadvantages of this engine are as follows:
- It should be noted that this game engine is not free, and to work with this engine for each person, the basic annual cost starts from $ 39.
This engine is more suitable for simple games with hard and complex mathematical vectors.
- To use this useful engine to design and develop different types of games, it is better to use the programming language for this game engine. The programming language of this engine is GML.
What famous games are designed using this engine?
- HOTLINE MIAMI
- THE RED STRING CLUB
- ALONE WITH YOU
Godot Engine
This engine is one of the game engines that can be used to design and develop different types of 2D and 3D games. Of course, this game engine is also cross-platform and can be used for Mac, Linux, and Windows operating systems and platforms. This engine is free, and you do not need to pay for it, and it also provides the source to the designer and developer for free.
This engine has many tools needed to design and develop developed games and applications ( in Slovak: navrhovať a vyvíjať vyvinuté hry an aplikácie ). With this engine, you can easily design your favorite games. This engine is completely free, and you do not need to pay to work with it; this engine is also MIT licensed.
What are the advantages of Godot Engine?
- This engine has its language, and to work with Sun Engine and use it to design and develop different types of game apps, it is better to use the language-specific to this engine. In addition to working with the special language, which is also very convenient, you can use other languages such as C ++ and C #.
- This engine is completely free and open source.
Popular games designed using this engine are as follows:
- StellarHub
- Grimante
- The Interactive Adventures of Dog Mendonça & amp; Pizzaboy
Unity2d
Unity Technologies developed Unity2d. The engine was introduced in 2005 as a specialized engine for OSX, one of Apple's operating systems. This engine is currently cross-platform and can be used for Mac, Windows, and Linux operating systems. Using this engine, it is easy to design and develop game applications for 27 different platforms.
The advantages of this engine are as follows:
Using this engine, you can use some powerful programming languages such as C # and Js.
There are many tutorials on working and using this engine on the Internet.
There is a free version for publishing games that can be used.
- Versions of this engine are stable and can be easily used for free at any time.
What famous games have been designed and developed using this engine:
- Cuphead
- Inside
- Ori and the Blind Forest
- Hollow Knight
3- Appearance, graphic and audio features:
If the game you are designing has a beautiful appearance and graphics, it will attract many users and gamers. In this part of game design, you must use graphic experts so that the appearance and graphics of the designed game are attractive and can attract many users.
Steps to create and design game applications using Unity Free
- Download and install Unity Free
1- To design applications and games, it is better to use Unity. To do this, it is better to download and install Unity. After the installation process is complete, we will see a page.
2- It is better to open this page than to create a new project and choose a name for the new project. For example, we can choose a name for a project like Iblejump.
Of course, it is very important to have a two-dimensional game. We must choose the option of the game being two-dimensional when creating a project in Unity. This is the "Setup Defaults For" option. After completing all the above steps, click on create.
3- After that, Unity has created an empty project related to the game, and in addition, it displayed a welcome page for us.
The screen is displayed, and the work area is divided into four sections.
- Create the first game
4- To create our first game, it is better to go to the Sprites folder first. In Unity, in the task area of the project, we created, selected Assets, and dragged the uncompressed folder to the gray area on the right. Of course, it should be noted that all spriters are included in this project.
5- Then, it is better to go to the Sprites folder and then find a Sprite named navbar. Once we find it, we go to the Scene.
6- Then, select the new object in the Inspector and click on Add Component. After we do this, I add the Box Collider 2D in Physics2D.
7- After that, we must go to the front and add a 2D Box Collider to our object. We must adjust the box colliders to match the size of the images, and I also set the size of x and y to 1.5.
- Add a Player
8- In this step, we click on the GameObject in the upper part and then select create. After that, I select the game object we want in the Hierarchy window. After selecting the desired game object, change the name to Player in Inspector. Then in Rendering, we add each Sprite Renderer component that is added.
9- In the Projects/sprites folder, find Idle_Sprite and click on it. After clicking, we must add one of the images to the Sprite value.
10- Select Rigidbody2D from the Physics2D option as another player and add it.
- Add Some Life to Robot
11- We can assign some motion and animation features to the play button at this stage. To do this, first, select the Player and then select the Animator Component. After that, it is better to go to Add Component - Miscellaneous - Animator.
12- Remove the Apply Root Motion icon and then select Animate Physics.
13- After that, I will open the Animator window. If Player is selected in the hierarchy, it is better to have a window Select Animation.
14- After that, it is better to open the asset/sprites folder and select the ready sprite. It is better to select Shift and then select the whole set and drag them to the moving window.
15- Then I look at Animator. If it automatically has two modes, we will have a moving robot by pressing the play button.
16- After that, we must create another animation and call it to drive. Use Drive Sprite. We lower the frame rate; it is better to set it to 20. If we examine the Animator window, we will see that the second model will be created automatically. After that, it is better to add a floating parameter called Speed to Animator.
17- We must click on Idle and select "make Transition." After selecting it, drive it.
- The Robot Controller Script
18- We currently have a player with several animated modes, and it is better to create a script to control the character after that. Add a simple C # script to the project.
19- In the Project window, I create a new folder and name the created folder Scripts. Open the created folder and add a new C # script.
It is better to call this script RobotController. I double-click on the newly created script until MonoDevelop gets started:
20- After that, it is better to save the script and return it to the Unity window.
21- Remove RobotController, a new script, from your project on the Player object in the Hierarchy window. To run the game, it is better to press the play button.
22- To create the game in such a way that we can create the possibility and ability to jump in it, it is better to add two other parameters to the Player Animator.
23- Add a float named speed and a Bool named Ground. I use speed to maintain vertical speed. The ground can also tell us when characters are present in games and the possibility of jumping.
24- It is better to create a new blank game and add Collider Circle 2D in the scene window.
25- After that, drag the Collider in the new Player object inside the Hierarchy window. We must set its radius to 0.1 and its conversion position to -1.
26- After that, we must update the RobotController script as follows:
27- Go back to the Robot Controller script in Inspector and set What Is Ground for everything except the Player.
28- After that, we select everything, open the dialog, and select the Player option.
- Destroyers
29- I create a quad.
30- Then on GameObject-. Click create other- Quad and change its conversion position to x to -25 and y to 0.
31- After that, it is better to set the conversion scale to a state rather than X 1 and y 25.
32- We need to assign an interesting name to the quad object. Like Destroyer Remove the Mesh Collider
33- Then add a 2D box collider and mark Is Trigger.
34- Then add a two-dimensional body and set the gravity scale to 0 in the Inspector window.
35- Select the Scripts folder and add a new C # script inside. We call it Destroyer.
36- I double-click on it until we select Monodevelop.
37- It is better to add the following codes in the new script:
38- Drag the Destroy script onto the Destroyer object.
39- Then, right-click on the Destroyer object in the Hierarchy window and select Duplicate.
40- I select the new position x = 0, y = -15 for the Destroyer and change its scale to x = 50 and y = 1.
- Change camera orientation
41- It is better to rotate the camera angle. To do this, we need to create a new script in Monodevelop to make the changes we want.
42- Place the script serially on the main camera and place the Player object on the script parameter.
- Add a Score
43- Add a new GUIText object from the GameObject menu and name it.
44- Change the value of Text in Score and its color to black in Inspector.
45- We also change the position of the Transform. X = 0.3 and y = 0.97