Jump to content
  • Advertisement
Sign in to follow this  
biggjoee5790

Starting Game programming.. Java?

This topic is 2785 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys.

So Ive been programming in Java for a few years now, but nothing game related. I am quite comfortable programming in Java.. although I do know Python and C/C++ on a beginner/medium level. Since I want to do game programming, and since its a notoriously difficult thing to do, I thought it would make sense to use the language that Im the best with. So, how can I start game programming in Java?.. or better yet.. should I even bother? If its a good idea,, what libraries will I need for 2D games? It seems like other languages are more clear cut... for C++ Id just use SDL, for Python I'd use pygame, etc. Mind you I dont want some pre fabricated game engine... just the API to access graphics, sound, input, etc. Basically I want to do as much on my own as I can, because its all about learning for me. Once I have a library, where do I start. People have said do something simple like tetris or breakout... but I wouldnt even know where to start.

Share this post


Link to post
Share on other sites
Advertisement
If you want the minimum for java, you want lwjgl. It's a wrapper around opengl with sound. If you don't need hardware accelleration, then you can program graphics and sound with java in an applet or whatever with the built in libraries. One site to ask more specific questions is javagaming.org.

Share this post


Link to post
Share on other sites
I was actually looking at LWJGL, seems good. So you said Id I dont need hardware acceleration, I could just use an applet? So I could just program all of my logic simply using the Java base language and display graphics using the AWT? Such as just drawing rectangles or whatever other shapes I need? Also, how do I know if I need hardware acceleration?

Share this post


Link to post
Share on other sites
If you need guidance of some sort thenewboston has 30+ javva-specific game programming tutorials (70+ java tutorials in total). He doesnt use jogl or lwjgl or anything, only things that come with java. A warning: this is for a game application(download) not an applet(like runescape for example). I believe roseindia(google it) has a java applet tuttorial as well. Sorry for no links/bad spelling,im on my phone.

Share this post


Link to post
Share on other sites
I dont have anything against Java, but I found XNA really easy to get into and start programming games with. You will be using the C# programming language so very similar to java, its just a change of syntax.

Share this post


Link to post
Share on other sites
I'd recommend C# over Java. Java is slow and memhog for me but that's just from what I've seen and felt. Plus also lacks operator overloading, so your math will look like crap when using it. C# does have XNA, while you could also use OpenGL if you prefer. But, go with C# and just forget about Java.

Share this post


Link to post
Share on other sites
Quote:
Original post by biggjoee5790
Also, how do I know if I need hardware acceleration?


Basically, if you want modern 3D graphics you need hardware acceleration, If you're just doing basic 2D you'll get by just fine without it allthough since 2D using OpenGL is fairly straightforward and AWT is a bit of a pain to use effectivly i'd recommend going with LWJGL even for 2D graphics and possibly JME for 3D (its a fairly good 3D engine so if you just want to make a game it will save you alot of time and trouble)

Share this post


Link to post
Share on other sites
Quote:
Original post by biggjoee5790
Since I want to do game programming, and since its a notoriously difficult thing to do, I thought it would make sense to use the language that Im the best with..

That makes a lot of sense. Game programming isn't too bad until you start writing really big games. Getting simple 2D games up and running shouldn't pose too much trouble for even a moderately experienced developer.

What might take time is adjusting to writing "simulation" code. It has a distinct type of flow which differs from normal batch or UI driven applications.
Quote:

If its a good idea,, what libraries will I need for 2D games? It seems like other languages are more clear cut... for C++ Id just use SDL, for Python I'd use pygame, etc.

I've had good results using LWJGL in Java. I believe it is used by Notch for "minecraft", which should indicate what you can do with it.
Quote:

People have said do something simple like tetris or breakout... but I wouldnt even know where to start.

Pong is a classic beginner game, and one of the simplest to write. At its simplest you need to be able to draw three quads, you can use simple AI until you have your input routines written. The other is space war, which is again quite simple. Each of these games requires two players and a single item of interest which will need collision testing.

Tetris and breakout are more complex for a first game, having many more objects and requiring a bit of work on the data side too.

Share this post


Link to post
Share on other sites
Quote:
Original post by SeaBourne
I'd recommend C# over Java. Java is slow and memhog for me but that's just from what I've seen and felt. Plus also lacks operator overloading, so your math will look like crap when using it. C# does have XNA, while you could also use OpenGL if you prefer. But, go with C# and just forget about Java.


Java 6 -xint is definitely slower. Steady State and Server however are faster then C#. If someone knows Java just fine, there's no reason they can't go with it. I personally think both JMonkeyEngine and XNA are great options for game dev.



biggjoee, depending on if your focus is 2d or 3d, you can look into slick2d for 2d games, and jmonkeyengine for 3d. Both are wrappers to the lwjgl.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!