12
\$\begingroup\$

I recently started to program some basic OpenGL stuff in Java, but OpenGL and DirectX is too much to handle and to understand for me and I'm getting bored really fast.

Now I am wondering if there are other possibilities than OpenGL (or DirectX) to make simple 2D graphics and to get started in Game Development, even if its limited. I will probably use OpenGL anyway when I am more experienced.

\$\endgroup\$

5 Answers 5

13
\$\begingroup\$

There is also the library Slick which provides the most common features for developing 2D games (images, animations, sounds, gameloop...). It has the advantage over the Java 2D library to be more specific to video games as it includes collisions checking and a physics engine.

\$\endgroup\$
5
  • 3
    \$\begingroup\$ Slick wraps OpenGl and hides the "hard stuff" \$\endgroup\$ Commented Aug 18, 2010 at 14:26
  • \$\begingroup\$ Slick is a great library and I highly recommend it. Unlike many game engines which force you to do things their way Slick gets out of your way and let's you focus on getting things done. \$\endgroup\$ Commented Aug 18, 2010 at 18:40
  • \$\begingroup\$ I will definitely try this, it seems really good \$\endgroup\$
    – Simiil
    Commented Aug 20, 2010 at 11:43
  • \$\begingroup\$ I highly recommend Slick \$\endgroup\$ Commented Aug 26, 2010 at 16:55
  • \$\begingroup\$ Slick has been deprecated for years as of 2018. \$\endgroup\$
    – Krupip
    Commented May 2, 2018 at 13:18
9
\$\begingroup\$

Of course! Java has a built in Java 2D library which requires no OpenGL or DirectX knowledge, and I highly recommend starting with it! In fact, it has pretty okay performance.

The essential starting point is to define your own class which extends Frame (or Applet), and then override the paint(Graphics g) method and use g to draw to the screen.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Indeed, nothing wrong with Java 2D. Just cast g to Graphics2D though, or you'll throw away all the things that make it good. \$\endgroup\$ Commented Sep 7, 2010 at 20:01
  • \$\begingroup\$ I like this answer (+1) because it suggests a pure-Java solution that doesn't require any third-party libraries that have non-Java components (e.g., such as those written and compiled in ASM/C/C++). \$\endgroup\$ Commented Jun 12, 2011 at 21:05
  • \$\begingroup\$ Yep, which makes it 100% portable (cross-platform), stable (since the Java 2D library has presumably been better tested than many of the 3rd party libraries out there), well-supported, and easy to develop and deploy. I also recommend the book "Developing Games in Java" by David Brackeen; in it, he develops a software 3D engine using only Java 2D, and the book of course explains it step-by-step including the math involved and the decisions and optimizations made along the way. It's very impressive and broken down so it's easy to understand. \$\endgroup\$
    – Ricket
    Commented Jun 13, 2011 at 2:17
3
\$\begingroup\$

Why don't you simply use Swing or Awt for a start (for 2D)? If you correclty design your game (I mean, a well though MVC design), you will be able to upgrage your game with a better game display engine later. The main goal, if you're working alone, is to quickly achieve to have something displayed on the screen, is'nt it ? It boosts your enthusiasm ...

\$\endgroup\$
3
\$\begingroup\$

Not exactly intended for games, but Processing is quite popular for 2D canvas graphics, it might be interesting to check.

\$\endgroup\$
2
\$\begingroup\$

Try basic canvas libraries if you are looking to develop just 2D games. I actually learn't to use 2D canvas by building a game on it right about the time this question was posted :) Now I am graduating to webGL.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .