• 0

Making a 2D game - JAVA vs C#


Question

Hi guys,

I have to make a 2D game using object oriented language - Java or C#. And there is a problem - I have never done a thing using Java or C#.

Which one do You recommend, Forum? Which is better for this task? What libraries can be useful during my work?

Link to comment
Share on other sites

Recommended Posts

  • 0

Hi guys,

I have to make a 2D game using object oriented language - Java or C#. And there is a problem - I have never done a thing using Java or C#.

Which one do You recommend, Forum? Which is better for this task? What libraries can be useful during my work?

I recommend you this:

XNA

Link to comment
Share on other sites

  • 0

As they said: C#, because you can use the XNA Game Framework and it'll make your life a lot easier. It's awesome for 2D games.

Also, C# is a better language overall, but that's more of a side issue.

Link to comment
Share on other sites

  • 0

Another +1 for C# and XNA. I program in C# all day at work, and I've done Java before too. I think C# is better. Plus Visual Studio is probably the best development tool you can get right now too.

Another +1 for C# and XNA. I program in C# all day at work, and I've done Java before too. I think C# is better. Plus Visual Studio is probably the best development tool you can get right now too.

Link to comment
Share on other sites

  • 0

Java is great for 2D and even 3D games, and given the right libraries (lwjgl, jogl, etc.), its performance is comparable. That being said, you'd probably be more comfortable with C# and XNA, especially if portability is a non-issue. Good luck!

Link to comment
Share on other sites

  • 0

If you want to make 2D desktop games, then go with C#. If you want to make 2D games that can run in a browser, then go with Java.

I personally use Java for my games.

Link to comment
Share on other sites

  • 0

I'm actually a big fan of java. It started life being pretty crummy, but nowadays, it's quite a good language. Having said that however, I do think c# and XNA would be easier

Link to comment
Share on other sites

  • 0
I'm actually a big fan of Java.

You're a chef and a programmer? You're so awesome!

Karwowski: are you restricted to a specific hardware platform or operative system?

Link to comment
Share on other sites

  • 0

Like Tiago said, it depends on whether you need portability. If you need the ability to run it on different operating systems (i.e. anything but Windows), then Java would be your way forward. If not, C# and XNA would be the way to go.

Link to comment
Share on other sites

  • 0

Like Tiago said, it depends on whether you need portability. If you need the ability to run it on different operating systems (i.e. anything but Windows), then Java would be your way forward. If not, C# and XNA would be the way to go.

Java's portability is excellent, but far from perfect. This is especially when working with OpenGL such as with JOGL and LWJGL. It's also not just the OS, it's also the version of the JVM that the user is running on. There are so many (I'm talking about the various update versions) and they pretty much all contain different bugs which can affect one person but no one else.

IMHO I think you should not worry about cross-platform; just pick your favourite OS and build for that. You'll get more done and can worry about going cross-platform on future projects.

Link to comment
Share on other sites

  • 0

You're a chef and a programmer? You're so awesome!

Karwowski: are you restricted to a specific hardware platform or operative system?

Was a chef, haven't been doing that in a few years. I'm not a professional programmer and never have any intention to be. I will make a program for my own purposes if I can't find anything for free or cheap that does what I want. Programming is more a hobby I occasionally pick up.

Link to comment
Share on other sites

  • 0

XNA is cross-platform: it runs on any Windows PC, the Xbox 360 and Zune. Java can theoretically run on a wider range of platforms, but not on Xbox 360 and not on Zune, and the experience will be nowhere as streamlined as with XNA Game Studio.

So, I don't buy "if portability is an issue go with Java". XNA offers very interesting cross-platform options that Java doesn't, although fewer and different.

Link to comment
Share on other sites

  • 0

XNA is cross-platform: it runs on any Windows PC, the Xbox 360 and Zune. Java can theoretically run on a wider range of platforms, but not on Xbox 360 and not on Zune, and the experience will be nowhere as streamlined as with XNA Game Studio.

So, I don't buy "if portability is an issue go with Java". XNA offers very interesting cross-platform options that Java doesn't, although fewer and different.

On the contrary, I don't buy the "XNA is cross platform between Microsoft platforms". Is that really cross platform? To me, a "cross platform game" would be XB360 and PS3, or Zune and iPhone, and so on. I'd think differently if XNA were available on non-Microsoft platforms, but since it is Microsoft-only for now and the near future, its just another case of Microsoft Lock-in. Don't get me wrong, XNA is aces for game dev in C#, but I certainly wouldn't consider it more cross-platform than Java.

Java's portability is excellent, but far from perfect. This is especially when working with OpenGL such as with JOGL and LWJGL. It's also not just the OS, it's also the version of the JVM that the user is running on. There are so many (I'm talking about the various update versions) and they pretty much all contain different bugs which can affect one person but no one else.

IMHO I think you should not worry about cross-platform; just pick your favourite OS and build for that. You'll get more done and can worry about going cross-platform on future projects.

While it is true that cross-platform shouldn't be his primary concern, the problem here is that we don't know what the OP's target platform is, if its Windows-based, then C# is fine, but since he offered Java, he may want to develop on Linux (where he could use Mono with C#, in theory) or Mac, or another platform, where Java would likely be the better option due to its wide range of libraries. Potential portability is a fortunate side-effect of using Java :)

Link to comment
Share on other sites

  • 0
On the contrary, I don't buy the "XNA is cross platform between Microsoft platforms". Is that really cross platform?
Yes, it is really cross-platform, according to a widely accepted definition of that term, anyway. Call it Microsoft lock-in if you want, but if it wasn't for XNA there would be simply no way to develop for Xbox 360, and get to actually sell your game on Xbox Live (unless you're a registered developer and bought the SDK - not an option for the masses). There's nothing similar available for other platforms either. So I don't see how one is unnecessarily tying to Microsoft technologies by choosing XNA, it's not like there was any equivalent alternative.
I certainly wouldn't consider it more cross-platform than Java.
I never said that either. I said it's a very interesting choice as a cross-platform solution, even though these platforms are different and fewer than the ones you can potentially target with Java. The reasons being ease of use (by an incredibly wide margin over any Java solution), great integration, possiblity of targeting a mainstream console, possiblity of selling on Xbox Live, excellent documentation, etc.
Link to comment
Share on other sites

  • 0

What are the actual design goals?

Like, is this for a class or something? Because if so then you won't really care about selling it on Xbox Live (for example).

Link to comment
Share on other sites

  • 0

Yes, it is really cross-platform, according to a widely accepted definition of that term, anyway. Call it Microsoft lock-in if you want, but if it wasn't for XNA there would be simply no way to develop for Xbox 360, and get to actually sell your game on Xbox Live (unless you're a registered developer and bought the SDK - not an option for the masses). There's nothing similar available for other platforms either. So I don't see how one is unnecessarily tying to Microsoft technologies by choosing XNA, it's not like there was any equivalent alternative.

I get that its cross-platform amongst Microsoft platforms, but the fact that the OP suggested Java in the first place suggest that his "definition" of cross-platform may not just include just Microsoft technologies, if in fact that's what he's aiming for. Thats why I don't consider it cross-platform in this respect. At the end of the day, I think the OP is a little too vague about what he's doing, which means we're both right :p

Link to comment
Share on other sites

  • 0

I get that its cross-platform amongst Microsoft platforms, but the fact that the OP suggested Java in the first place suggest that his "definition" of cross-platform may not just include just Microsoft technologies...

I disagree. Just because he mentioned Java doesn't mean he's interested in cross-platform. I do most of my programming in Java, and I very rarely care about running on multiple platforms.

It's a mature, popular language which is taught in institutions all around the world. That's probably why I think he mentioned it.

Link to comment
Share on other sites

  • 0

Java is not really for game design unless it's for a mobile phone or something. Android (I think) and Blackberry (the OSes) are all setting on Java run time (again I think). Only Windows Mobile uses .net which is hopeless.

But for learning anyway, I highly suggest start with Java, not because of anything else, Visual Studio just make people lazy, automated codes (I don't mean auto complete) just confuse people at beginning of learning something.

Regards cross platform, there are Software Cross Platform and Hardware Cross Platform, PC, Xbox, Windows Mobile that's hardware platform and Windows, Mac and Linux that's software platform.

Anyways, if you are a true programming if you figured out one, it's very very very easy to pick up the other one. Especially Java and C#, as they are so similar.

Link to comment
Share on other sites

  • 0
But for learning anyway, I highly suggest start with Java, not because of anything else, Visual Studio just make people lazy, automated codes (I don't mean auto complete) just confuse people at beginning of learning something.
Visual Studio doesn't do any more code generation than the popular Java IDEs like Netbeans and Eclipse; that is, if you're building a GUI using the designer (or other "designer mode" scenarios). And in XNA Game Studio there is no code generation besides a few barebones class templates.
Link to comment
Share on other sites

  • 0

I disagree. Just because he mentioned Java doesn't mean he's interested in cross-platform. I do most of my programming in Java, and I very rarely care about running on multiple platforms.

It's a mature, popular language which is taught in institutions all around the world. That's probably why I think he mentioned it.

Even so, the fact that he mentioned Java means that we cannot assume that he's developing on Windows, since both C# and Java can run on GNU/Linux.

My point is, if Windows is the target platform, then C# and XNA are definitely the way to go about what he wants to do, but since he also mentioned Java, we cannot assume that Windows is his target platform. He might want to run it on multiple PC operating systems, in which case recommending C# would be bad, but then again, he might not have been aware of the XNA libraries if he's developing for Windows. We don't have enough information to give the OP a conclusive answer.

My Take on it is this:

  • If they're developing for Windows and/or XBox and/or Zune, then C# and XNA all the way
  • If they're developing for any other PC OS, or attempting cross-platform between non-MS platforms, then they're likely better off using Java and various libraries mentioned in this thread.

Link to comment
Share on other sites

  • 0
My Take on it is this:

  • If they're developing for Windows and/or XBox and/or Zune, then C# and XNA all the way
  • If they're developing for any other PC OS, or attempting cross-platform between non-MS platforms, then they're likely better off using Java and various libraries mentioned in this thread.

(Y)
Link to comment
Share on other sites

  • 0

XNA is not officially supported on Silverlight. There is SilverSpark for getting XNA projects running under it, but AFAIK it doesn't support everything (although I've not used it). This is one area that Java is better, it takes about 3 or 4 lines of code to get an applet running as a desktop app and Java penetration is much wider then Silverlights.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.