"Klavasaur" - game keyboard simulater
Melnikov Gleb Vladimirovich-programmer;
Kashtanov Arseny Sergeevich- artist.
Our YouTube: Youtube.com
Link to download game: Beersaur.itch.io
In our time, the use of a computer has become commonplace. We use it to search the Internet for information, communicate with friends, work, and have fun. At the same time, a lot of time is spent on printing. To reduce such costs, there are many keyboard simulators, such as:" VerseQ"," Stamina"," Klavarog " and others. Some of them are not very functional, but if the simulator has a lot of features, such as" Klavarog", in which you can even type in various programming languages, which is useful for programmers, still, there is not enough fun. This is necessary so that the user is not bored to write certain phrases, and at first one word many times. Games can help with this.
There are keyboard simulators with games, such as "Typing Master", but not all games are fun and with a user-friendly interface. Therefore, we decided to create our own product, combining a computer game and a keyboard simulator.
The idea of creating a game arose long before the beginning of writing the project work. We, playing the Dinosaur from Google Chrome, thought: "what if the dinosaur jumped over the cactus only when the player wrote the right word". Indeed, it is much more difficult and the game will not only be fun, but also useful for the speed of printing.
While writing the code for the game, we encountered a lot of difficulties. At first, the idea was to write a game in the language “Python", because of its popularity, simple syntax and knowledge of the basics of this language by us. We thought to work with the "Pygame" library, but after writing more than 100 lines of code, we were convinced that libraries are not the best" tool "for writing games, because it will take much more time than creating the same game using the" engine " - the basic software of a computer or video game. That's why we decided to use the engine instead of the library. There are engines for the “Python” language, but they are not very popular, which makes it difficult to work with them, because we have no experience with these engines. And, if we consider the most popular engines, not taking into account the languages that can be used there, one of the most popular is “Unity", and we decided to choose it. Unfortunately, you can't use the "Python" language in this engine, so this work became a "test" for us, we started studying the "C#" programming language, which is the main one in the "Unity" engine.
Studying the mechanics of the games, we realized that the dinosaur is always standing still, it just has a motion animation, and the whole world: cacti, earth, pterodactyls move towards the dinosaur. But, in the beginning, we did the opposite and thus, the dinosaur will change its position and go behind the screen, which is a huge disadvantage. From physics, we know that it doesn't matter whether the plane will move relative to the air or the air relative to the plane. This is how planes are tested for stability, we are talking about a wind tunnel. It's the same here, the dinosaur will stand still, but we'll think it's running.
There are several ways to make a jump, of which we know: using the Addforce and Velocity methods. To use them, you must use the Rigidbody component, which is responsible for the interaction between objects, using physics. First, we made the jump linear using Velocity. We equated this function to the vector of the jump direction-Vector2. up, which was multiplied by a variable of the float - Jumpforce type, which stores a certain number and controls the height of the jump. But, later it became clear that it is better to use a parabolic jump. This jump looks nicer. The Addforce component helped us with this. Addforce is a group of methods, in which we again included Vector2.up * Jumpforce;and also added an instantaneous force pulse – ForceMode2D.Impulse.
For the appearance of an object on the scene, in a certain tab of the game, we began to use cloning objects after a certain time and deleting them when they went out of the camera (the screen we see). There was also an option to use the method of returning the object to its original place when it went outside the camera. But, at that time, we did not know how to do this, so we used the first method. To do this, we have introduced a variable that controls the frequency of appearance of objects. And a variable that is responsible for the position at which you can create new clones of the object. We equated it to a random location, within certain X-axis coordinates, using the Random.Range () method, in which we entered the maximum and minimum coordinates within which a clone of the object can appear. To delete an object when it has gone beyond the screen we can see, we created a new object and added a tag to it-a reference word so that it can be designated. If there is a collision with this object, the desired object is deleted using the Destroy () function, in which our object was written.
The main part of our game was the implementation of the input of the necessary words. To do this, we created an array in which we included the necessary words. And output from it a random one of these words to the string Text. To do this, we used the Random.Range () method, in which we wrote the ordinal number of the first and the ordinal number of the last elements. It was among them that a random ordinal number was selected and an array element with this number was output, that is, the word we need in the Text string. This word had to be entered in the InputField object, and when we pressed the Space key, we checked whether the strings, that is, our words, matched. If yes, then the string was reset by assigning an empty string to it, in our case it looked like this: "currentInputField.text="";", using the Random.Range () method, a new word was selected again, the dinosaur performed a jump, and the number of words was also counted. It was easily implemented with a single variable, when the condition was met, we added 1 to it (initially it was equal to zero), and output it to the string.
With graphics, things were simpler, this part of the work was done much faster than writing code. But many things, as in the code, have been redone many times. For example, the cover that the player can see in the menu was redrawn more than 6 times.
While testing an early version of the game, we were struck by one moment, our classmate, in less than an hour, inspired by the game, wrote 68 words, starting with 4. At that time, there were no levels in our game yet, and any words/expressions from 4 to 6 characters could be requested for writing. We wondered what would happen if we played our game regularly for a month, how much would the result be fixed and raised?
Thus, having asked this question, a test was conducted, during which one subject learned to quickly type on the Russian keyboard layout using our game for a month. The results were as follows: for the first time, the participant was able to write only 10 words at the "beginner" level-writing 4 characters, but after a month, his level rose to 100, thus increasing the speed of writing 4 characters by 10 times! The "experienced" level-writing 5 characters was more difficult, but despite this, the subject began to type 5 characters 8 times faster, raising his result from 5 to 40 words. And in the level "Rukoklav" - writing 6 characters, the number of words increased from 3 to 20, thus increasing the speed of writing 6 characters by about 7 times! The participant was able to repeat all the results, proving that they did not fix this printing speed for one day, as it was the first time.
In the course of our work, a keyboard simulator game was created, which helps to optimize the time spent on printing text. The game has already been tested by people, in the number of 15 people and received a positive reaction.
As a result, we have a finished product.We will try to interest our users later by adding a variety of characters with different mechanics, which will help to diversify the game.