How to create your game

Anonim

How to create a game

Some users who are interested in computer games sometimes arise about creating their own project. However, it is so easy to not realize it, because one idea is not enough. At a minimum, you will have to master special software or online service, but ideally it will be necessary to stock programming languages. As part of today's article, we will demonstrate three possible methods that allow you to create a game, and you, pushing out from the material seen, look at the appropriate option and start learning.

Create your own computer game

The guidelines below will help us only to deal with the principle of creating games with the help of different tools, they are not universal or full lessons, having mastered which, you can become a professional developer. We offer to use them as a familiarization tool that comes to the subsequent training of Gamedev.

We also recommend paying attention to the fact that further information will be focused on computer games. If you have a desire to make mobile projects, we advise you to get acquainted with the other material on our website by clicking on the reference below.

Read more: Ways to create a game on Android

Method 1: Programs for creating games

First of all, consider special programs that allow you to create a project without programming skills. Today we will focus on a well-known version. Game Maker is one of the easiest and most popular programs for creating 2D games. Here is available to create games using the DRAG'N'DROP interface or using the built-in GML language (we will work with it). Game Maicker is the best option for those who are just starting to develop games.

  1. Go to the "New" tab and create a new project.
  2. Creating a new project in the Game Maker program

  3. Create sprite. Right-click on the "Sprites" paragraph, and then "Create Sprite".
  4. Creating a new sprite for playing Game Maker

  5. We ask him the name, let it be Player, and click "Edit Sprite". A window will open in which we can change or create a sprite. Create a new sprite, we will not change the size.
  6. Editing ready-made sprite for game Game Maker

  7. Twice click on the new spray. In the editor that opens, appears the ability to draw sprites. At the moment we draw a player, namely the tank. Keep our drawing.
  8. Creating an object for playing Game Maker

  9. To make the animation of our tank, copy and paste the image with the combinations of Ctrl + C and Ctrl + V, respectively, and draw it another position of the caterpillars. Allowed to do so many copies as you consider it necessary. The more images, the more interesting the animation.
  10. Animation of an object for playing Game Maker

  11. You can put a tick opposite the item of the preview. You will see the created animation and you can change the rate of frame changes. We save the image and center it with the "CENTER" button. Our character is ready.
  12. Saving a tank for playing Game Maker

  13. In the same way, we need to create three more sprites: the enemy, the wall and shell. Let's call them Enemy, Wall and Bullet.
  14. Creating new sprites to play Game Maker

  15. Now you need to create objects. On the Objects tab, press the right mouse button and select "Create Object". Create an object for each sprite: OB_Player, OB_EENY, OB_WALL, OB_BULLET.
  16. When creating a wall object, check the box in front of the item "SOLID" . It will make the wall of solid, and the tanks will not be able to pass through it.

    Go to the Object Management tab in the Game Maker program

  17. Go to complex. Open the OB_Player object and go to the Control tab. Create a new event with the "Add EVENT" button and select "Create". Right-click on the EXECUTE CODE item.
  18. Creating a new object controller in the Game Maker program

  19. In the window that opens, you need to register what actions will be performed by our tank. Dial these lines:

    hp = 10;

    dmg_time = 0;

  20. Create the Event "STEP" and in the same way in the same way for it code:

    image_angle = point_direction (x, y, mouse_x, mouse_y);

    If keyboard_check (ORD ('W')) {Y- = 3};

    If keyboard_check (ORD ('S')) {Y + = 3};

    if keyboard_check (ORD ('A')) {x- = 3};

    If keyboard_check (ORD ('D')) {x + = 3};

    If keyboard_check_released (ORD ('W')) {Speed ​​= 0;}

    If keyboard_check_released (ORD ('S')) {speed = 0;}

    if keyboard_check_released (ORD ('A')) {Speed ​​= 0;}

    If keyboard_check_released (ORD ('D')) {Speed ​​= 0;}

    If Mouse_Check_Button_pressed (MB_Left)

    {

    With instance_create (X, Y, OB_BULLET) {Speed ​​= 30; Direction = Point_Direction (OB_Player.x, OB_Player.y, Mouse_x, Mouse_Y);}

    }

  21. Creating events for playing Game Maker

  22. Add an event "Collision" - a collision with a wall. Code:

    x = xpRevius;

    y = ypRevious;

  23. And also add a collision with the enemy:

    If dmg_time

    {

    hp- = 1.

    dmg_time = 5;

    }

    dmg_time - = 1;

  24. Event "Draw":

    draw_self ();

    draw_text (50.10, String (HP));

  25. Add "STEP" - "END STEP":

    If Hp.

    {

    Show_Message ('game is finished')

    room_restart ();

    };

    if instance_number (ob_enemy) = 0

    {

    Show_Message ('Victory!')

    room_restart ();

    }

  26. Menu with game events in the Game Maker program

  27. When finished with a player, go to the OB_EMY object. Add an event "Create":

    R = 50;

    Direction = Choose (0.90,180,270);

    Speed ​​= 2;

    hp = 60;

  28. Add "STEP" to move:

    If Distance_TO_OBJECT (OB_Player)

    {

    Direction = Point_Direction (X, Y, OB_Player.x, OB_Player.y)

    Speed ​​= 2;

    }

    ELSE.

    {

    IF R.

    {

    Direction = Choose (0.90,180,270)

    Speed ​​= 1;

    R = 50;

    }

    }

    image_angle = direction;

    r- = 1;

  29. "END STEP":

    If Hp.

  30. Create the Event "Destroy", go to the "Drawing" tab and in Other item click on the explosion icon. Now, when killing the enemy will be an explosion animation.
  31. Creating a Destruction Effect in the Game Maker Program

  32. The event "Collision - a collision with the wall":

    Direction = - Direction;

    Event "Collision - a collision with a projectile":

    HP- = IRANDOM_RANGE (10.25)

  33. Creating a collision effect with a projectile in the Game Maker program

  34. Since we do not fulfill the wall, go to the OB_BULLET object. Add collision "Collision with an enemy" (ob_enemy):

    instance_destroy ();

    And "Collision with a wall" (OB_WALL) with exactly the same code:

    instance_destroy ();

  35. Collision effect with a wall in Game Maker

  36. Finally create the level of "Level 1". Click the right click "Room"> "Create Room". Let us turn to the Objects tab and with the "Wall" object, draw a level map. Then add one player and several enemies. Level is ready!
  37. Creating a game room in the Game Maker program

  38. Now we have the launch of the game and testing it. If you follow the instructions, there should be no bugs.
  39. Testing the finished game in the program Game Maker

We looked at the Game Maker only as the simplest example, but now users are available many of the most diverse similar applications to create games without knowing Yap. Therefore, the user opens a wide selection of a suitable tool.

As you can see, nothing complicated in the creation of the game through GameFroot is not. From the user it is only required to deal with scripts, which, perhaps, is the most difficult part of this method. Otherwise, it remains only to show creativity and use the fantasy to get a good and playable product without using programming skills. In addition, the functionality of this web resource allows you to work with many genres, and you can also start working completely with a clean sheet.

As already mentioned earlier, such gamefroot services, there are many, they all work in about the same principle. However, you can hardly find a site with Russian localization, so you have to master the English interface language.

Method 3: Development Environment and Programming Language

We approached the most difficult, but at the same time an interesting way is to use the programming language as a tool for writing your own game. Immediately, we want to note that now we will not provide the only universal instruction that will help to deal with all aspects, since this material is unrealistic. In exchange, we will provide leading materials for those who are interested in learning and the further development of their identity in the field of Gamedev.

For example, take the famous millions of Minecraft game. Of course, it is quite simple, but at the same time shows that even one person can create a project from scratch on its own, which will become popular with the entire world community. This application was initially written in the Java language, and Marcus Persson (Notch) worked over him. From this it comes out that almost any user, having started learning Java, will be able to achieve at least a little approximate result by writing their own project. However, for this will have to work quite a few. There are special faculties in universities, training the basics of programming, but not everyone wants to be submitted to the university, therefore pay more attention to paid courses or free materials, textbooks. All of them are not listed, we indicate only one of the well-known services for beginners called Javarush.

Training Azam Programming on Javarush website

The whole course is based on practical classes with a detailed and understandable explanation. The first lessons are available for free so that the user can understand whether to further pay attention to such learning. Orientation here goes on those users who have never faced coding, and explanations, illustrations and feeding material will especially be especially interested in adolescents. However, this service has and minuses, among which the tightness of the lessons and a huge number of repetitions of the same material are very distinguished that in the future begins to annoy. Try to get acquainted and go through the lessons on Javarush using the link below.

Go to Learning on Javarush

Simple applications can be created in those languages ​​that are more easily learning. For example, Python develops quite quickly enough, and many vacancies appear on the market for Python developers. In the screenshot below you see the almost complete fragment of the code describing the well-known application "Snake".

Appearance of the source code of the game snake in Python

Now look at what this game looks in the screenshot next. This result can be achieved by two weeks of study, but for this you have to make a lot of effort.

Simple snake game written in Python Programming

As for the AAA-class projects, Java and especially Python significantly pass their positions in front of C and C ++. The predominant most game engines are written on these Yaps. They are designed specifically for large companies or borrow from independent manufacturers. In addition to this, several programming languages ​​are often involved in huge projects, which sets the need for programmers to study them all. From this it turns out that starting its movement on the way of developing large projects is not so simple. To do this, you will definitely need to sign up for online courses or to enter the higher educational institution. If you are interested in this case, familiarize yourself with one of the most famous courses for creating games from Geekbrains on the link below.

Get acquainted with the course on the development of games on Geekbrains

During the study, the Yap should take care of the development environment where the code will be written. To deal with this will help our separate material further, where it is described in detail about the most popular and high-quality IDEs for different languages.

Read more: Select programming environment

Above you have been familiar with three different methods of creating computer games. As you can see, they all differ in the complexity and quality of the product obtained. Therefore, the choice remains for you - to make a simple project quickly, without using programming skills, or go through a large and complex course of study, getting the opportunity to become a professional in this matter.

Read more