XN4SL is a library dedicated to port existing XNA 2D games to the Sliverlight platform. XN4SL emulates XNA Framework classes for use with Silverlight applications. On current project stage XN4SL supports 2D games based on the Platformer
XNA Starter Kit from Microsoft XNA Game Studio 3.0. Most of the game functionality was achieved and only minor changes in the code are required.
Any feedback or help will be great. If you create a game powered by XN4SL that you would like to share, you can submit it to
To play game powered by XN4SL click the link
How to create your own Silverlight Platformer game powered by XN4SL?
Required tools: Microsoft Visual Studio 2008 SP1 with Silverlight Tools and XNA Game Studio 3.0.
- In VS2008 create new project: "XNA Game Studio 3.0"->"Platformer Starter Kit 3.0" and name it "SilverligthPlatformer"
- Create new "Silverlight"->"Silverlight Application" project with the same name "SilverligthPlatformer"
- Add all (except "Program.cs") c# source files from XNA project main folder to Silverlight project
- In Silverlight project create a new folder and name it "Content"
- In a newly created folder copy selected content files from XNA project "SharedContent" and "HighResolutionContent" folders. Copy font file "Peric.ttf" to "Content\Fonts" folder. You should finish with folder structure
same like this:
- Add all previously copied files to your Silverlight project, and set properties to "Content/Do not copy".
- Open file "Content\Fonts\Hud.spritefont" and change:
- For the fonts embedded in Silverlight plugin just enter the font name like "Verdana", "Tahoma", etc. Be aware that you can't distribute font files if you don't have rights to do this.
- Download Xn4Sl.dll library or project source files and add its reference to your Silverlight project.
- In all source files change using statements and references from Microsoft.XNA.Framework... to Xn4Sl.Framework...
- In PlatformerGame.cs->LoadNextLevel() change:
- In Level.cs change: "using System.IO;" to: "using Xn4Sl.Framework.IO;"
- Finally change App.xaml.cs->Application_Startup method:
this.RootVisual = new Page();
var game = new SilverlightPlatformer.PlatformerGame();
this.RootVisual = game;
Adjust some constant values like TargetFrameRate, MoveAcceleration, MaxMoveSpeed etc.
To read more about XNA game development visit Microsoft