Porting a game to Windows Phone using Xamarin

I currently have a very simple memory game for Windows Phone, which I would like to transfer to iOS, Android, and possibly Win8 using the Xamarin tools.

I would like to centralize my business logic in one assembly and just create a user interface for each platform.

For the most part, the code is simple C #, but I use Bitmaps to display maps in the game. However, from what I read, there is no standard support on different platforms for using raster images.

What would be the recommended approach to this problem?

I think I should use something like MonoGame, but I feel that this is too much for what I want to do.

+4
source share
2 answers

You say your code is in C #. As far as I know, Xamarin is the only way to get C # code to work on Android and iOS. Xamarin has a free starter edition that you could use, but your application will be limited in size. As soon as you click the size limit, you will need to pay for the license.

Once you decide to pay for the license, no other costs are required if you want to use MonoGame for the port. If your game already uses XNA or you have XNA experience, I recommend using MonoGame. MonoGame is an XNA port and is designed to create games, so many game-related tasks are simpler.

An alternative is to create your game as an application using the standard API for building applications. It is possible, but I do not see any advantages in this, if you are not trying to save money using the free version of Xamarin. If you plan on making more games in the future, you'd better bite the bullet and learn MonoGame.

Using bitmaps with MonoGame should not be a problem. Although you may need to convert them to PNG first.

Centralizing business logic in one assembly is something like using Portable Class Libraries, but due to PCL limitations it is often easier to use file sharing. Basically you have a soft link to the files in each project. Updating files simultaneously updates them in all projects, but when adding new files you must add them to each project separately. This is a bit of a pain in maintenance, but not much.

+2
source

Of course, as a starting point, you should separate the interface and the logic.

To achieve this, I highly recommend you make a version of the console game. Using the console, you can send commands only with parameters to the application. No mouse or keyboard in real time. All tasks related to the user interface will be left. All that remains is business logic and commands to use.

Then you should try MonoGame . It is reliable enough for 2D games. Moreover, if the IL code is not too much, it is free for iOS and Android !

Another way ... Unity 3D . Using this engine depends on the code you wrote. In some cases, you can use this game engine with a common business logic. Thanks to the new Unity 3D policy , indie game developers were free to create and deploy their games.

In short, the plan is this:

  • Implement the main functions (with console input / output);
  • Then select the engine and implement the user interface for the target platforms.
0
source

Source: https://habr.com/ru/post/1482265/


All Articles