Tutorial [Java]: Asteroids Game

I've finally gotten around to writing a new classic game for everyone to look through, Asteroids! This was an interesting project to work on because of how fundamentally different it was than the games I'd worked on previously. Both Tetris and Snake are grid-based and have very little going on in terms of updates, and Asteroids diverged from that greatly.

Unfortunately, I lost interest in working on this pretty quickly, so it's not entirely finished. There are currently no enemy ships, hyperspace feature, or explosions, and there are a lot of things that need tweaking to feel right. But other than that, everything (seems to be) in place and working. So, rather than waiting to finish it before I release it, I thought it'd be best to just release it in it's current state, and finish it at a future date.


As always, feel free to contact me by leaving a comment or messaging me on YouTube if you have any questions or comments.

Download Source

Bookmark the permalink. RSS feed for this post.

12 Responses to Tutorial [Java]: Asteroids Game

  1. Replies
    1. Could you explain what is wrong? I just checked and everything works fine (though I did find and fix a small bug with the rendering.

      Delete
    2. this is what sipted to me
      java.lang.UnsupportedClassVersionError: org/Game : Unsupported major.minor version 51.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(Unknown Source)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$000(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      Exception in thread "main"

      Delete
    3. inside of asteriods.class
      AsteriodSize spawnSize = AsteriodSize.values()[size.ordinal() - 1];
      showed me a breakpiont
      i think dat's all

      Delete
    4. inside of asteriods.class
      AsteriodSize spawnSize = AsteriodSize.values()[size.ordinal() - 1];
      showed me a breakpiont
      i think dat's all

      Delete
    5. its equal to your coding
      i changed the .classpath and .proyect mine to yours
      and showed that asteriods has lots of errors

      Delete
    6. when i used the fix setup all the errors disapired but still doesnt work

      Delete
    7. when i used the fix setup all the errors disapired but still doesnt work

      Delete
  2. How did you make the ship to appear?

    ReplyDelete
  3. Really interesting, thanks so much!

    ReplyDelete
  4. I have a simple question: I wanted to get started with java by downloading Asteroids, a game that I played in my youth (a long time ago). I am using netbeans under Fedora21 and have successfully compiled the program. However it will not run because netbeans can not find any main classes. I checked by running the program from the command line and I get the same type of error. Evidently there is something very basic about this that I am missing. Please give a suggestion. Thank You
    Tom

    ReplyDelete

Search

Swedish Greys - a WordPress theme from Nordic Themepark. Converted by LiteThemes.com.