Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I code Windows 8 RT Games in C#

Is it possible to code a Windows 8 RT and/or Windows 8 Phone game using C#?

like image 233
Vaccano Avatar asked Jan 21 '13 18:01

Vaccano


1 Answers

I have done a fair amount of research on the "Games in C#" thing, so I thought I would post it for others:

XNA is an easy way to make a C# game. You can post a new XNA game on the Windows Store and it will work fine.

However, you cannot make a Windows Phone 8 or Windows 8 game using XNA. (You can only target version 7.1 of Windows Phone.) The new APIs for these operating systems are not supported in XNA.

However, both Windows Phone 8 and Windows 8 will run XNA apps. Those apps just cannot target any features that are specific to Windows 8 or Windows 8 Phone.

So to sum up. The current version of XNA (4.0) supports the older API to talk to Windows and Windows Phone. They can still run on Windows 8, but you can't use the newer stuff.

Microsoft does not have an offering to make games in C# for the new Windows 8 and Windows Phone 8 APIs.

However, if you don't mind using open source projects there are some things you can do to write a game in C# that can use the newer Windows 8 and Windows Phone 8 API:

MONOGAME

If you want to use XNA's api to make games for the new Windows 8 APIs you can use MonoGame (this is what I use). It is an open source api that implements the XNA API but has plugins for IOS, Android and Windows 8. This is a really good cross platform option. 3D graphics recently became supported by MonoGame(i.e. Infinite Flight, Armed). (Note: I am not affiliated with MonoGame in any way.)

SHARP DX (DirectX)

If you want a Microsoft Supported way to make a game that targets the Windows 8 API your best bet is DirectX. But Direct X is a C++ API. It is also really really hard.

If you are wanting to make a 2D game (like Plants vs Zombies or Angry Birds) then Direct X is overkill. You are far better off going the MonoGame route. I spent several days digging through tutorials and working very hard to understand Direct X. By the end of that time I was rewarded with the ability to draw a single triangle on the screen. (That same amount of time had my game loop going and sprites moving around in MonoGame.)

So I repeat, if you don't already know DirectX and you are making a 2D app, don't go down the DirectX/SharpDX road.

The DirectX 2D route is further hindered by Windows Phone 8 not supporting Direct2D. DirectX has a subset called Direct2D for 2D rendering. However, this subset is not supported on Windows Phone 8. The "replacement" (for now) is the Direct X toolkit.

If you are still all in with the Direct X road, then you can write it in C# using SharpDX. It is a C# wrapper for DirectX that works very well (though I don't know if it supports the Direct X Toolkit).


SUMMARY

The short of it (for me) is that Microsoft did not update their APIs for C# game development to support the new stuff in Windows 8 and Windows Phone 8. But MonoGame lets you use the XNA API to do just that. It also allows you to write cross platform games, so it is better anyway. (You get porting to IOS and Android for "Free".)

My game is well underway in MonoGame with no issues so far!

like image 96
Vaccano Avatar answered Oct 31 '22 17:10

Vaccano