Hello,

I'm currently looking for a book the covers "how to develop a game". I have basic knowledge of Java. I know: arrays,classes,GUI,basic animation with Timer class,basic graphic. I want to move on and start learning threads, collitions, keyboards and mouselistener and all other game related topic... I was wondering if you can suggest me a book that would cover these topic and help program my first game.

Thank you in advance

Dani AI

Generated

— good next steps. As suggested, a beginner-friendly, hands-on book like Beginning Java SE 6 Game Programming is a practical place to learn keyboard/mouse handling, timing, simple collision boxes and a small project. For a deeper, example-rich dive into active rendering, animation and Java3D, consider Killer Game Programming in Java. For threading and safe concurrency patterns use Java Concurrency in Practice. For architecture and common game patterns read Game Programming Patterns. For collision math and robust algorithms consult Real-Time Collision Detection. (pages.cs.wisc.edu)

Move off a Swing Timer toward an explicit game loop and active rendering (Canvas + BufferStrategy). Use listeners only to set input state flags; do physics and collision checks inside the update step on the loop thread. Start with simple tests (AABB or circle-vs-circle), draw debug bounds, then add spatial partitioning (quadtrees) if many objects are present. A simple fixed-timestep loop (with interpolation for smooth rendering) keeps physics stable. See the BufferStrategy guidance for active rendering. (docs.oracle.com)

Pick a framework once the basics are clear: libGDX for cross-platform 2D/3D, or jMonkeyEngine for full 3D. Workflow: build three tiny projects (pong clone, simple platformer, small shooter) to practice loop/input/collision; profile for GC and CPU hotspots; keep heavy I/O off the render/update thread and follow the concurrency patterns in Goetz et al. for any shared-state threading. (libgdx.com)

Example loop (illustrative):

long last = System.nanoTime();
while (running) {
  long now = System.nanoTime();
  double delta = (now - last) / 1e9;
  update(delta);   // physics, input, game logic
  render();         // draw via BufferStrategy
  last = now;
  Thread.yield();
}

Recommended Answers

All 2 Replies

Have look at Beginning Java Game Programming (Amazon link) I read few chapters from their JME version when I needed some 3D for mobile development

thank you peter :-) i will.

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.