Hi, do any of you know any good resources for (2d) game development in java? I want to build a game but need a good tutorial/resource for such a thing. Can you help?

Dani AI

Generated

This thread asked for 2D Java game-development resources. started the question and replies from and pointed to a tutorial and to community help. Below is a short, modern starter pack and practical next steps that complement those suggestions without repeating links already posted.

For libraries and reading:

  • Consider a modern, cross-platform engine like libGDX (good for desktop + Android and well documented).
  • Use Processing when you want rapid visual prototyping and fewer setup details.
  • If you need low-level OpenGL access, try LWJGL.
  • For architecture and design patterns, read Game Programming Patterns.
  • Keep the Java basics handy at the Oracle Java Tutorials.

A short, practical workflow to get a playable 2D prototype quickly:

  1. Pick a framework (libGDX recommended) and create a minimal project with Gradle so builds are reproducible.
  2. Implement a simple game loop: update with a fixed timestep or a clamped delta time; separate update and render stages.
  3. Use sprite atlases and batching to reduce draw calls; load assets on a background thread before gameplay.
  4. Start with simple collision (AABB) and tile maps (use a map editor) rather than full physics; add Box2D only when needed.
  5. Profile early (VisualVM/JFR) and avoid per-frame object allocation to reduce GC pauses.
  6. Package and test on target platforms; desktop JARs differ from Android builds.

Notes and cautions: many older Java tutorials assume applets or deprecated APIs. Prefer current frameworks (OpenGL-backed engines) for performance and cross-platform deployment. Community forums, current engine docs, and pattern guides will save time once the basics are working.

Recommended Answers

All 2 Replies

There is a full tutorial on creating a 2D "Space Invaders" game in Java here:

There is also a 3D "Asteroids" tutorial on the same site.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.