Java 2D Game Programming Platformer Tutorial - Part 1 - The Game State Manager
Why Stack Overflow recommends it
Stack Overflow users link it as a beginner-friendly walkthrough of Java 2D game structure, including game loops, collision and animation, when answering hobbyist game questions.
Recommended by 3 people across 3 different months, 2013 to 2015.
What it is
First part of a Java 2D tile-based side-scrolling platformer tutorial series by ForeignGuyMike, focused on building a game state manager and a basic game loop with Swing. The author notes it is an old tutorial with flaws, especially its multi-threaded key input handling.
What people said
Recommends Kyranstar · 2014-04 · Stack Overflow · on “Java 2d RPG game with multiplayer support”
This video [LINK] is how my good friend learned java development. Obviously you're not going to find any tutorial that follow your exact needs, but this one is semi-close. I believe it goes into networking later in the series. This video [this video] is also very good, but it is farther away from your specifications. Another, better thing you can do is follow simpler tutorials [LINK] until you know what you are doing, then change the source around to fit your specifications. Generally if you do not know any java at all, starting with a game like this is not a very good idea. But if you are very motivated, it can be done. By the way, this broad type of question is not very well suited for a Q & A
Recommends Loa · 2014-12 · Stack Overflow · on “Java 2D Game Performance with Java Swing Timer”
I advise you that you change your Swing engine for JavaFX (at least), a technology with better performance and more tools to your disposal. Swing nowadays is considered a dead technology, as well as with the AWT before it. A great place to study and start JavaFX would be this one: [LINK] The ideal for the development of games, would be to use a library prepared for it, such as libGDX: [LINK] But if your desire is to create a game in Swing, who am I to judge? Sometimes it is good to see old things. I myself still like Swing, even being obsolete compared to other things. I think you may be implementing a wrong gameloop. Swing Timer does not really seem like a good way to update game logic. Eve
Recommends 34638a · 2015-01 · Stack Overflow · on “Collision detection in maze 2D java game”
This isn't exactly about making pac-man in java but it is about a 2d platformer which has all the collision mapping in 2d space and how to create and add objects such as a player and enemies with animations included in it, you should find it useful on the whole: [this video] Note you will need to handle the AI for the ghosts on your own :D disclaimer I did not make these video's I just found them very useful.
Cites SirTrashyton · 2013-12 · Stack Overflow · on “Java Game Loop Explanation”
Recently, I've been getting into Java Game programming. I have learned Java before, but this is my first time with Graphics, Game Loops etc. I followed this [this video] tutorial for a Game Loop, and it's working pretty well. There is nothing wrong with it, but I just can't figure out why I am thread.sleeping the code, and whats the point of it. If anyone could explain what start, elapsed and running do, and why I am doing thread.sleep(wait) then I would be super appreciative! GAME LOOP (Remember, it works, I just don't know why): while (running) { start = System.nanoTime(); update(); draw(); drawToScreen(); elapsed = System.nanoTime() - start; wait = targetTime - elapsed / 1000000; if (wait < 0)