Java 2d Games with Java SWING

My friend and I began to develop the game in the same way as Zelda for SNES using Java . The only problem is that we don’t know what to use: our own engine with AWT or if we can use SWING to simplify it.

So a short question:

For java-2d soft games, is it a good or bad idea to use Java Swing?

And why?

Please note that the game is not "heavy". Thanks in advance!

+8
java swing 2d
source share
2 answers

I tried this several times and found that:

  • If your graphics are non-rotating (or quadrant-rotated) sprites and fixed or tiled background images, this is usually fast enough.
  • If you need to rotate images or draw geometric shapes (with Graphics2D ), forget about it. It can slow down scanning with only 20-30 polygonal vertices on the screen. If you do a lot of rotation and scaling, then you will probably be better off with a 3D wireframe, even for a 2D world.

If you chose swing, learn how to use the BufferStrategy class.

Also consider PulpCore .

+7
source share

Although you could use the Java awt and swing libraries to create the game, it will probably be easier for you to find the library that matches the game and create around it. Handling is a great choice, especially for beginners. http://processing.org/

+2
source share

All Articles