tags:

views:

1858

answers:

9
+6  Q: 

XNA on iPhone

I don't know if it's a strange question but how could I run a game made with XNA on the iPhone/iTouch ? Which steps/tools (existing ones or imaginary...) should be used ?

note: The goal is to avoid modifying existing C# code

UPDATE :
If I understand correctly, I must be able to:
1) Run my XNA code on Mono (monoxna or SilverSprite, promising?)
2) Run Mono on iPhone (MonoTouch)

A: 

For starters you would need a CLR implementation on the iPhone, which doesn't exist at the moment, but it seems someone is trying: MonoTouch.

Martinho Fernandes
+4  A: 

I don't believe there is a good answer to your question. XNA doesn't target the iPhone, so the chances of being able to effectively port an XNA game without modifying the C# source code isn't likely to happen.

Instead, I'd recommend that you take a look at the various frameworks that exist to help you craft cross-platform games. Unity often comes up in these discussions, but it isn't free.

If cross-platform isn't your goal, but free iPhone development is, then I'd recommend looking at Cocos.

Edit: The MonoTouch project may be able to assist you in the future, but doesn't help you out right now. Still, it's something to keep an eye on.

Gabriel Isenberg
You can add that Java or .NET support on the iPhone platform is very unlikely. To elaborate on that (though I might be wrong here), Apple seems to want complete control over development for the iPhone, meaning you must pay a license fee to deploy C/C++/Objective-C programs to it; while .NET and Java provide more end-user programmability than Apple is comfortable with.
Cecil Has a Name
+5  A: 

The MonoTouch project may eventually help here, since it allows you to write C# targeting the iPhone (it is statically compiled to native code).

Jason
But if he's targeting XNA, he'll be modifying the code. I do think that project is cool and a worthwhile direction.And OMG on the no-JIT clause. That's even worse than the Android decision to not use a JIT for Java.
280Z28
I don't think Apple allows interpreters besides their own. Is that why no JIT, I wonder?
Nosredna
I just read the MonoTouch low-level debugging page. Yikes.
Nosredna
+2  A: 

I believe XNA depends on Direct3D 9 (see http://msdn.microsoft.com/en-us/xna/aa937793.aspx), which may hint at the hurdles one might encounter in both porting to mono as well as having sufficient graphics horsepower on iPhone.

Curt Nichols
XNA depending on DirectX, I agree, is the greatest hurdle. .Net on iPhone is possible. To get XNA on iPhone requires implementing the XNA graphics stack on iPhone.
Peter Lillevold
+1  A: 

Everyone saying this is possible because there are CLR libraries for Mono, does not even think about the fact that XNA is a WHOLE DIFFERENT set of frameworks:

"The XNA Framework class library is a library of classes, interfaces, and value types that are included in XNA Game Studio."

As another responder noted, this is so far from happening it's not even funny. If you really want to write a game I'd check out Unity. It's commercial, but it looks utterly impressive and you can script your game logic in Javascript or (here's the funny part) C#!

Yes, instead of going through a ton of work to port a whole framework because you want to write a game in C#, why not just use a framework that lets you do that today?

Kendall Helmstetter Gelner
Thx for the answer. My project is nearly finished so I was wondering if there was a way to make it portable with minimal effort ;) (a rewrite is not an option)
Jodi
I'd give it serious thought if I were you. You could probably reuse all your graphics assets, and since the scripting is in C# I'll bet a lot of your game logic would port as well. If it's a good game you could get quite a lot of users on the iPhone.
Kendall Helmstetter Gelner
+1  A: 

From the horse's mouth:

MonoTouch + SilverSprite = XNA 2D games on iPhone? :)

What Bill means is that it will eventually be feasible to write a 2D XNA game, then use SilverSprite to run it on Silverlight, then use MonoTouch to run it on the iPhone

Joel Martinez
That's good news! It's cool to know talented people are interested to bring XNA to the iPhone!
Jodi
A: 

mMay I invite u to join my site www.mymonotouch.de , a new developer community,..for discussing monotouch problems

Ploetzeneder
+8  A: 

Not only is it possible but here is a video of someone doing XnaTouch on MonoTouch: http://bit.ly/13jdEV

here is the mono article about doing it http://www.mono-project.com/MonoTouch

Bob The Janitor
You'll need some #if in your source code to change the namespaces, but XnaTouch is pretty useable from my experience.
John JJ Curtis
+1  A: 

This space is definitely heating up. There is now an XNA Touch project on codeplex that aims to bring the XNA API onto the iPhone/iPad platform:
http://xnatouch.codeplex.com/

Joel Martinez