I have been programming for about a year now, and have a very good grasp on all the basic of programming in generally and am a pretty decent Java programmer, so now that I have the time I would like to start making games in Java. However, Id really like to not use any extra libraries, and just use pure Java for the first little bit until I fully understand the mechanics of a video game.

I have been looking around the internet and have seen more "best ways" to do this than I can count. So if somebody could point me in the right direction that would be great! (As in send me to the best, easiest to follow, and most up to date resource either print or on the web)

It just seems that no matter where I look I get completely different info on the same subject. So I would really appreciate if somebody could just give me a resource that follows whatever the current standard is. P.s typed on my phone so sorry for any typos :-)

Edit: I think I will simplify my question a little bit. In my main class where my game loop is should I be extending canvas, JPanel, JFrame, or something else? This is my main point of confusion right now because I have seen it done all these way and everybody has an opinion on what is better.


closed as not constructive by MichaelHouse, John McDonald, Josh, Tetrad Feb 13 '13 at 16:40

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    \$\begingroup\$ What kind of game do you want to make? Also, "how do I get started" questions are not recommended here, check the faq. \$\endgroup\$ – Laurent Couvidou Feb 13 '13 at 11:02
  • 3
    \$\begingroup\$ please include the resources that you have found as part of your question \$\endgroup\$ – user25712 Feb 13 '13 at 11:04
  • 1
    \$\begingroup\$ Why are you afraid of using external libraries? Why reinvent the wheel when you can just an existing solution and save time you can use on implementing your actual game idea? \$\endgroup\$ – Philipp Feb 13 '13 at 15:39
  • \$\begingroup\$ Because at this point I am more interested in learning, I know its the hard way but I find I have always benifited by learning how to do things the hard way first. Then when I do everything the easy way I know where the easy way came from, and have a greater apreciation for it. Just the way I learn best. \$\endgroup\$ – user2066990 Feb 13 '13 at 17:01
  • \$\begingroup\$ About your edit. Using JavaFX instead of Swing will probably be better solution since it contains scene that can be build. Otherwise I would render to JPanel, and use JFrame for standard swing menu. see for example this question gamedev.stackexchange.com/questions/70711/… \$\endgroup\$ – Piro Dec 4 '17 at 9:33

When you want the current standard method to build a game engine then I have to disappoint you: there is no such thing. The reason why you see so many "best ways" is that there is no such thing as a best way to program a game. There are countless ways to skin the cat. Some are faster or slower, some are cleaner or messier. In the end every game plays differenty, so it's just logical that they also work completely different under the hood.

Use your intuition and do what feels like it will result in an efficient and maintainable software architecture.

Regarding your question where your game loop should be:

I wouldn't recommend you to extend a GUI class and do it there, because it is usually a good idea to separate the visual representation from the gameplay itself. When you claim to be a decent Java programmer, you are certainly familiar with the MVC pattern. This pattern also applies well to game development. Implement the gameplay (model) in one class, the graphic engine which visualizes it (view) in another and the user input handling (controller) in a third class, and let them communicate through well-encapsulated interfaces. That way you can easily make changes to one without affecting the other.

  • \$\begingroup\$ Thank you :) very helpful :) and yes I am familer with the MVC pattern most examples I looked just seemed to not apply it. But thank you again :) \$\endgroup\$ – user2066990 Feb 13 '13 at 16:35

You should really consider the lwjgl solution http://www.lwjgl.org/, even though you clearly stated in your question that you dont want to rely on libraries.

It includes alot of what you will need. Think about it again.


I found these youtube tutorial series to be very informative:





The question is somewhat contradictory. First of all, if you want make game, even very simple you should use libaries that help you in that task. Otherwise you are just unreasonably making things hard for youself and simultaneously losing time (eventually you will be forced to use some kind of library or engine anyway). So if you think that using libraries somehow will hurt your gamedev skills in future - you are wrong.

There is no really "current standard" for game development, unless we are talking about some fundamental things such as ubiquitous "game loop". By "no standards" I mean that there are different approaches to different aspects of a game. As a result there is really no specific answer to how you should make your game.

I find it's easy to start by making clone of some simple game of the past, like Tetris or Breakout.


Not the answer you're looking for? Browse other questions tagged or ask your own question.