One C# game to rule them all(iOS, Android, WP7, W7, Mac OS X and XBOX)
Hey, I'm learning C# and just thought of a cool idea. Considering that a game was simple enough. Say, a remake of a classic text-entry style game, a C# 开发者_开发百科game could theoretically be ported to all of the platforms I listed above, with little to no change of the original source code, correct?
Obviously the UI would have to be tweaked, and I highly doubt such a game would really survive on each of those platforms!
But, although C# is really MS heavy, through different methods, that could work, right? Or, would I have to change the C# source to Objective-C? Does Android even have an official language that they support like Apple and MS do?
This is kind of an odd question, but if this is true, then C# is really a nice all-purpose language even though it's largely based on and endorsed by MS.
I decided to post an answer cause I thought of a few more relevant things to say.
First to answer your questions: Yes it would work. No, you wouldn't have to port to Objective-C. Android's apps often use Java.
And a bit more background...
I'm hearing good things about MonoTouch and MonoDroid for cross platform development using .Net, C#.
You've already accepted that you'll have to handle UI layers specifically for each platform, so you're on the right path.
Importantly, on Sept 9, Apple relaxed their guidelines that previously prevented apps built using Monotouch from being released in the marketplace.
Statement by Apple on App Store Review Guidelines
In particular, we are relaxing all restrictions on the development tools used to create iOS apps, as long as the resulting apps do not download any code. This should give developers the flexibility they want, while preserving the security we need.
Also of interest, from Craig Dunn's blog...
ConceptDev (Craig Dunn's blog): MonoTouch meet WindowsPhone7
Mostly it is a pipedream, you could use C#/XNA to make an Windows/Xbox/WP7 game and likely use C# via Mono/MonoTouch to make a OS X/iOS implementation. Android doesn't have a suitable mono implementation at the moment to support this though.
This is not at all meant to be discouraging, also MS has given the C# language to the community so that is positive..
http://www.microsoft.com/interop/cp/default.mspx
I am not a game development expert, but here my 2 cents,
You dont have any problems with developing games in c# targets all the platforms, mono c# runs sucessfully in all above said plaforms including monodroid - andriod and MonoTouch - iphone.
But the problem is specific to the graphic libraries you are going to use. For example Xbox libraries only targets windows. But if you stick with openGL, you may solve the problem.
You may be better off sticking to C++, for which iOS and Android have native support.
There's no reason to need C#, after all you can use Vb.net for ASP.net development :) (no joking, its a better language especially considering the embedded xml support VB has)
However, for mobile development, I think you're going the wrong route for cross-platform development. For this, you're always going to get 80% of the coverage, that last 20% is going to be a pain. For example, if you choose C#, you'll get Windows and XBox, but not Playstation and very poor iPhone.
So, you need the lowest common demoninator - and that's probably C++. You can put a Qt GUI on top (with the excellent QML which is possibly the best UI tech at the moment), and that'll run on most platforms - including Android. But not WinPhone7. C++ is still a good option for all platforms as even Windows will run it (C++/CLI) and there's easy bridge between objective-C and C++ anyway. Your best option is probably to go that route (and a lot of games development is done in C++ anyway so its not wasted effort).
Chances are though, you're not ever going to get a single codebase to work well enough on all platforms. Perhaps javascript would be the ultimate though, as MS' Bob Muglia has said they're not focussing on Silverlight anymore, preferring HTML5+javascript for cross platform work.
精彩评论