Using ShapeRenderer for debug graphics

As your project grows in size and complexity, more bugs and glitches will appear. Regardless of how brilliant you are, this is inevitable. Traditional debugging techniques such as logging and stepping through code instructions are extremely helpful, but sometimes they are not the best when it comes to detecting issues in visually rich real-time applications, such as video games. This is especially true when you have many game objects on screen, which could lead to conditional breakpoints hell.

Sometimes it is a lot easier just to render some extra information on top of the game world. When you think your entities are not drawn at the right places, why not add a grid showing the world axis and units? Maybe ...

Get Libgdx Cross-platform Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.