Silverlight 5Integrated with xNa, Windows Phone 7.1 also has the SL. xNa model. moonlight, a mono-based open-source product, can be deployed on multiple platforms. It can be seen that Silverlight is approaching the ultimate goal of cross-platform deployment.
In order to move towards a great dream, we may wish to start in-depth exploration from the two-way migration between Silverlight and Windows Phone 2D.
In the first five sections of this series, I have explained a Silverlight browser-based SLG game demo. It is no good to use this game as a seamless migration case to the Windows Phone platform, just a few simple steps:
1According to section 6To create a Windows Phone game project in SL. xNa mode.
2Open Section 5OfSLG demo game source code, Set all the classes andCodeCopy to the project in step 1.
3Run the game project (download the source code of the WP Version).
Speechless... Isn't that a joke? Is it so simple?
Yes, if you integrate the code of the two projects into one, it will become a perfect cross-platform in the true sense. To further prove the correctness of this point of view, I processed the Silverlight arpg game demo source code in another tutorial using the above method, as shown in the following code:The entire process is only a few minutes (Download WP source code):
Heaven! Earth! Ah?
Don't sigh, this cross-platform porting efficiency is exaggerated. For 2D games with low performance requirements, the cost is very good, especially for Silverlight 2D games that have optimized storyboard and dispatchertimer, its actual effect is particularly outstanding;
However, everything has to be viewed on both sides.
If the game has a large computing volume, a large number of images are displayed on the same screen, a large size, or even a large number of 3D models, this solution is absolutely not available for Windows Phone phones with low configurations. So we have to start with the SL. xNa mode in Silverlight 5 and Windows Phone to find a perfect solution.
It's time to get started. From the next section, I will shoulder the heavy lifting of building a cross-platform 3D game, this article explains how to build a high-performance 3D game framework based on Silverlight and Windows Phone.It will be available soon ~ Stay tuned.
Recommendation reference:NowpaperAnd Williams's game development blog on Windows Phone.