DEV Community

Cover image for Learn How To Code Your First Game In Java With CodeGym
CodeGym
CodeGym

Posted on

Learn How To Code Your First Game In Java With CodeGym

We’ve got a problem, Cap!

Most attempts to learn programming (or something else) on your own simply fail. Every self-taught risk to catch a loss of motivation for various reasons. For example, some coding topics may seem too complicated and incomprehensible. Or, on the contrary, you move so easily that there are doubts that you move in the right direction. It is tough, to estimate your own successes. How to do it? Where to go? And also, rookie programmers very often lose their motivation due to the fact that they do not see the final or even intermediate result of their work.

It’s too dark in here… I can’t see the results of my job!

This problem is typical not only among students but among professional programmers as well. Software developers who work on large complicated projects in big teams and make a small piece of code of a huge program. The effect of this piece is not always visible, much more often it just lost there, drowning among the same pieces made by their colleagues.

Programming students have slightly different problems. Most often they study some topics, solve some tasks to consolidate knowledge divorced from reality, but globally do not see what they have learned and what they actually can or cannot do. In fact, the result is the same as that of professionals: they do not see the result of their efforts.

Yep, quite a problem… What should you do?

Dropping your programming learning out isn’t a good idea. The better way is to dilute it with something else. Something interesting for you, where the result will be visible.

Programmers who work in big outsourcing and product companies very often “entertain” themselves by creating their own projects. We recommend the same method for advanced students. Most often, novice developers write small games based on classic ones, and sometimes they realize their own ideas.

But what should coding rookies do, those who are not ready for a relatively interesting project on their own? Now on the Internet, you can find enough step-by-step instructions. Following them, a student creates their own project with the help of more experienced developers. A great example is free to use CodeGym Game Section. There you can create your own versions of classical games under the clear guidance of professionals. Now you can try to write your own interpretation of 6 games: Minesweeper, 2048, Snake, Space Invaders, Moon Lander, and Racer.

Alt Text

To code such game, you need to have only basic knowledge of Java, which can be obtained quite quickly: initial knowledge about classes and objects, basic primitive data types, String, loops and branches, arrays and initial knowledge about the ArrayList structure. The CodeGym authors recommend completing the first 5 to 10 levels of the course to get such knowledge. If you don’t feel confident enough, here is a useful theory that helps you to solve the tasks.

However, CodeGym Games section is apart of the main course and available to everyone, not only for CodeGym students.

Each game is divided by two dozen subtasks as well as step-by-step instructions. First, you get your subtask and tips, then write your code. When you finish, CodeGym auto validation system is checking your code. If everything is ok, you go to the next step.

Alt Text

When you complete the last step, you get a ready-to-use game. You are free to publish it on the site, and sharing with your friends or modify the code to improve it or propose something original into old ideas. All the games use simple CodeGym game engine, you can read about it in this article.

CodeGym Games section is a great way to write your first complete game project, modify it and understand how to develop indie projects by yourself. After such exercises, you are ready to continue your learning and to think of your own original projects in the near future.

More about CodeGym Games: https://codegym.cc/groups/posts/137-new-section-on-codegym–games

Go to code: https://codegym.cc/projects/games

First published on Technotification

Top comments (0)