JavaRush /Java Blog /Random EN /In the beginning there was JavaRush
Марат Каджаев
Level 20
Санкт-Петербург

In the beginning there was JavaRush

Published in the Random EN group
My first probationary period ended 3 years ago, but I only now have time to write an article. At the university I spent 1 year in different faculties: the first semester I studied to become a manager, in the second semester I transferred to software engineering. I hoped that they would teach me how to program, but I was mistaken, so I took the documents and decided to learn everything on my own. The only thing I am grateful to the teacher for is that he advised me to start with Stephen Prat’s book “The C Programming Language.” Really good book with lots of practical problems. The book took about 2 months, after which I came across JR in a friend’s groups and away we go. At first I planned to become an Android developer, but during the learning process the backend seemed more interesting to me. By the way, the training took 3 months, during which I reached level 20, after which I decided to try to find a job. First of all, I moved to another city, because... There were no vacancies for a junior Java developer in mine. I found a company, responded, received a test task, which was given a week to complete. It was necessary to write a simple web application using Hibernate, Servlet\JSP and MySQL. Of all these words, I only knew that MySQL is a database. At first I was very upset, I even decided to look for vacancies at some KFC for now, but then I finally decided to try to fulfill the technical specifications - I will always have time to get a job at KFC. I did the test non-stop all week and succeeded. I sent the solution, but it was “ugly”, so I remade it 4 more times. The last decision turned out to be correct, but it turned out that developers had already been recruited and the next recruitment would be in 3 months. Shtosh, okay. For the next 3 months I learned html, css, js, sql and php. What is PHP doing here? I needed a server-side language that would respond to requests and all that - servlets and jsp seemed too complicated to me at that time. The result was a full-fledged web application with a terrible interface, the code of which I posted on github for my portfolio. Just by this time, 3 months had passed and they wrote to me from the same company and called me for an interview and gave me another simple test task for knowledge of SQL, which I completed in a few hours. The person with whom I talked about the job hinted that they would ask about algorithms and data structures - I had not yet mastered this topic, but there were 15 days before the interview, damn us racers. Robert Laforet's book "Data Structures and Algorithms in Java" helped me. I didn’t have time to read and understand it all in two weeks, but I still learned a lot of new things. And then the day of the interview came, I arrived at the appointed time, 2 men met me and the interview began. To say that I was worried is an understatement; my voice was even shaking. They asked about everything except algorithms and data structures. They asked about Spring, DI, IoC, Hibernate, how the JVM works, how the GC works - I did not answer any of these questions. I only coped with questions about Java Core (collections, exceptions, OOP, etc.). Already at the interview I realized that I had failed it, but it was still disappointing not to receive any feedback. But I identified gaps in knowledge and began to diligently close them. I found a job a month after the failed interview. By the way, I came across the vacancy in the JavaRush discussions. First there was a Skype interview with a recruiter (lasted about 2 hours). They asked about Java Core, GC (now I knew how it works), databases, data structures. Then the interviewer asked me to share the screen and write a calculator. I almost screamed with happiness because I wrote the calculator literally a week before. Confident in myself, I started the task, but either out of excitement, or for some other reason I forgot part of the algorithm. The screen is shared - it’s scary to go to Google. Luckily I had a cell phone that saved my ass. The next day they called me for an in-person interview and a couple of days later I received an offer.
In the beginning there was JavaRush - 1
The work was not official, I was in the role of an apprentice for an individual entrepreneur. We wrote a service for creating events, selling tickets and all that. I remember my first day at work - the individual entrepreneur spent 15 minutes explaining what needed to be done. - Well, is everything clear? - asked the IP - Mmm, not really, can we do it one more time? — I asked wildly worried. The IP explained everything again. - It is now clear? - Now yes. In fact, I didn't understand ANYTHING. But I was afraid to ask for an explanation again - I think everyone who got a job will understand me. The essence of the task was to rewrite from thymeleaf to AngularJS. Fortunately, I found part of the ready-made code and followed the example and did the same. I didn’t understand how it worked then, but I managed to cope with the task. Then came the tasks related directly to the backend part. Only after practical experience with Spring did I begin to understand what was written in the book “Spring for Professionals”. I worked there for 8 months, after which I moved to another city, where I quickly found an official job, worked for 2 years, and at the same time changed my job title from “Junior” to “Middle”. Now I am faced with the fact that work has turned into a routine and does not bring a bit of pleasure. Therefore, at the moment I took a break, and in order to prevent my fingers from atrophying during the break, I decided to try another field - game development. Namely, mobile game development, for starters, Android, because... I know Java. I’ll tell you about this now in detail. About us In a short time, a small team of 4 people (including me) came together: 2 developers, 1 game designer, 1 sound engineer. Because No one on the team had any experience in the field of game development and my time off was limited, we decided to implement a simple project that we would definitely see through to the end. They did it! Initially, the deadline was November 15, but, as you know, finishing a project on the original deadline is a sin. So we finished it two weeks later. According to those The stack is: Java 8 and libGDX.

About the development

The start of development can be considered October 17th. In total we spent 45 days, during which:
  1. learned to work with libGDX;
  2. wrote the code;
  3. drew graphics;
  4. made music;
Those who have already seen the game may have a question - why is it taking so long, the game is simple? Yes, this is true, and to be completely precise, the development itself (writing the code) took about a week and a half. The rest of the time can be divided between:
  1. mastering the engine;
  2. drawing pictures and then redrawing them;
  3. writing music;
  4. searching for sounds on https://freesound.org ;
  5. reading a bunch of articles about how to promote games
Plus there were moments of “downtime” for various reasons - someone had an exam, someone had a retake, etc. You can safely spend a week and a half, or even more, on “downtime”. Another part of the time was spent on “debates”: ideas about what to add to the game came almost every day, so there were disputes about “this would be superfluous”, “this would not fit in”, etc. Thus, we abandoned many ideas, for example, adding running cockroaches that you can crush and get extra for it. points: In the beginning there was JavaRush - 2In general, one of the most difficult things, in my opinion, is to decide in advance what will be in the game and stick to this plan without trying to add “another” feature. This is how we accumulated these 45 days. The game prototype was ready after a week and a half. During this period, we didn’t really have graphics yet, so we took some things from the public domain (for example, we borrowed a background sheet of paper from Doodle Jump), and some we created ourselves in paint. In the beginning there was JavaRush - 3The game is technically very simple - we didn’t even need to use box2d (physics engine), we could handle collisions and calculate the hypotenuse ourselves. Of the most interesting points, I will highlight the following.
  1. Initially, all elements in the game were generated randomly. Those. we have providers of black holes, scissors, shurikens, rods, hearts - we put them in an array, and then we take a random provider and get an element with random coordinates. Quite quickly it became clear that this approach was “not very good”; our friends who took part in testing told us the same thing and advised us to use templates. Surely for those involved in game development this is an obvious solution, but... We are new to this area and this was very good advice for us.

    Thus, several patterns emerged: valley of scissors; diagonal rods - it’s quite fun to assemble them at high speed (swish-swish-swish with your finger); and one more template, I don’t know what to call it - I’ll call it what the class is called in the code: StraightForwardPattern.

    In the beginning there was JavaRush - 4

    It became more pleasant with templates, but it was too predictable or something. Therefore, the same random became another template. Those. Now we have “static” templates and one random one. (here is a meme about perfect balance).

  2. The main problem we encountered was this. LibGDX calls the render(float delta) method in an endless loop, in which all the rendering of elements actually occurs. We draw a pencil line in the following way: we take the coordinates of the finger and place the texture there. So, if we moved our finger across the screen very quickly, “holes” were formed because we ended up in those milliseconds when the render(delta) method had already worked and had not yet been called again. The problem was solved quite simply - we remember the last coordinate in which the texture was drawn, we get the next one, and if the distance between them is greater than X and the finger was not released, we fill this gap. At first we thought that this option might not work - the lines would be angular, but our fears were in vain - everything works as it should.

    Actually, about the game

    The gameplay does not pretend to be unique, but it is quite good and can be addictive. You control a pencil, literally draw on paper, dodging obstacles - scissors, shurikens, black holes. In this case, the pencil core ends and you need to pick up small pencils. In case the rod comes to an end and there are still no pencils, you can pick up a fragment of a mirror. It will have an effect for a few seconds - instead of wasting the rod, it will be restored, but at the same time the control becomes mirrored - you move to the left, and the pencil draws to the right. You can also pick up a heart that will allow you to encounter an obstacle once and stay alive. The longer you hold without lifting your finger from the screen, the higher the combo will be, which increases the speed of gaining points. Plus the speed of the game gradually increases. Unless you can't rob the Korovans. In the beginning there was JavaRush - 5Initially, we planned to call the game Karan Dash (a pencil, ahaha, got it, right?), but later we changed our minds and settled on Pencil Dash. The motivation was that this elegant (I’m saying) play on words would be understandable only to a Russian-speaking audience. We released the game a couple of days ago and are now promoting it. No one on the team has any experience in this either; we gleaned all the knowledge about promotion from various articles. We published information about the game on various websites/forums for free. As for paid channels, we ordered advertising on 4PD, from one blogger, several posts in VK and AdMob public pages. By the way, this post is also part of the promotion, so with the permission of the administration I am leaving a link to the game here. Game page on Google Play: click I’ll also leave a link to our VK group, where you can leave reviews/suggestions and not miss an update click I’ll be grateful if you install it (what if you like it?), and for a review with a rating I promise to light a candle for your health! Ask questions, if you have any, I will answer.In the beginning there was JavaRush - 6

Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION