AsteroidsGDX 1.0

AsteroidsGDX is an action game where you have to maneuver your spaceship around dangerous asteroids flying through space while collecting pickups and shooting bullets to reach a new high score.



After programming an unfinished Asteroids prototype as a warm-up exercise for Ludum Dare 29, I decided that this would also be an appropriate way to get me started using LibGDX. So I took the graphics from the old project, but started coding on a new and empty LibGDX project. This time things went a little different. To handle the collision checking I used a complete physics engine this time. I already knew dyn4j from previous projects, which is why I choose that over Box2d which is the usual physics engine to use with LibGDX, so that I didn’t have to use yet another new API. Having the power of a full blown physics engine, I thought it would be nice if asteroids would not glide through each other, but to prevent them from sticking together I made them very bouncy. This had the desirable side effect of making the game more interesting, because if two harmless looking asteroids collide there’s always the risk that one will bounce in the direction of the player.

Because I didn’t plan to take part in a game jam the next day (I am waiting for the next Ludum Dare, though), I had more time and made a more finished version of the game. But this is only the first version I’m releasing to the public, so I haven’t gotten much feedback on it yet. If you have comments or suggestions feel free to post them on twitter or reddit or send me an email.

LibGDX exports for desktop, web and mobile, but certain criteria must be met:

1. Exporting for web is done using the Google Web Toolkit (GWT), which translates Java source code to JavaScript. Because of certain limitations of JavaScript and browsers some classes from Java are not supported. Dyn4j uses some of these classes, which is why I can’t export this game to web. For the next project I will probably use Box2d, which comes with LibGDX and works with GWT.

2. Android requires source level 6 and RoboVM (used to export for iOS) and GWT require source level 7. For this project I used Java 8, though, and made heavy use of the new language features (lambdas!) and APIs.

As this project started as an experiment to learn LibGDX, I focussed on different things while programming it and noticed these requirements only while half-way through the project. And although I could solve these issues, it would take a medium to large amount of work. Because of that and because it is only a hobby project my plan is to not yet tackle these problems and only provide a desktop version. For my next project I will keep these requirements in mind though and hopefully be able to target a wider range of platforms.


Use the AsteroidsGDX tag to find the latest version.

Download AsteroidsGDX 1.0 here (requires Java 8).



Posted in Game Development
Tagged with: , , ,