Game Programming Language

Started by
7 comments, last by Clapfoot 14 years ago
I am currently writing a game when a friend of mine asked if he could run (test) my game on his computer (Macbook Pro). Since I'm writing the game using the XNA game studio so told him that answer is most likely no. To be honest, it's my first game and is still really rough around the edges so His question also got me thinking. Is there a common language that I can use to write a game compile it and then run it on Windows, Max OSX or Unix / Linux?
Advertisement
C, C++, Python, pretty much any language actually...

Your problem isn't the language, but the library that you're using. The XNA library is Microsoft-only. If you were using C# but different libraries you could make your game work on other OSs.
Quote:Original post by Hodgman
C, C++, Python, pretty much any language actually...

Your problem isn't the language, but the library that you're using. The XNA library is Microsoft-only. If you were using C# but different libraries you could make your game work on other OSs.


Pretty much this.

Honestly though, if this is your first game, i'd stick with XNA a while longer if you've gotten used to it. It's really easy to do the actual 'game' programming with XNA instead of fighting concepts like pointers that people struggle with.
One possible workaround exists. I've tried it on a test game and got it to work:

Use SilverSprite. To quote from the page:
Quote:Run XNA games without code changes in Silverlight 3. SpriteBatch based graphics only, no 3D. Since the game compiles into straight Silverlight code, it will run anywhere that Silverlight can.


And Macs can run Silverlight: see here. Some tweaking may be needed, but this can allow your XNA game to run on a Mac.

Thanks for the replies!

I figure that once the game is done, I will consider ways to port the program to C/C++ or start work on something new.
Java and python are languages that can run on all platforms out-of-the-box so to speak. C# can also do that if not using XNA/DirectX.
With C/C++ you gotta make sure you're using all portable libraries (like SDL) and not use any platform specific code.
Don't forget about Mono if you want cross platform support from PC to the Mac.

theTroll
There are probably tons of solutions out there depending on your needs, but if you're planning on writing native code and using OpenGL then your best bet is probably using c/c++ in conjunction with a cross-platform windowing library like SDL or GLUT.
I've also heard great things about QT but I haven't personally tried it myself.

This topic is closed to new replies.

Advertisement