Using JSIL to Convert Your XNA Games to HTML5 (Part 1)

I just recently learned about JSIL, after attending the August 2011 CTXNA users group.  I am really excited about JSIL because it will allow me to broaden my game audience.  I haven't yet converted any of my games, but I am in the process of setting up JSIL.  What I have learned so far just in getting it setup is that you must clone the JSIL repository and include the sub modules.

At first I was only cloning the directory without the recursive attribute and as a result I was missing several projects in my solution.

I used the following command to download it with the sub modules:

c:\mydir\>git clone

After downloading it, my build was still failing because it did not have reference to XNA 3.x framework (I only have the XNA 4.0 framework).  For some reason, JSIL references XNA 3.x framework in one of the projects (Proxies.XNA3).  Therefore I had to download and install the XNA 3.x Game Studio.  If someone else knows a better way of resolving this please don't hesitate to let me know.

After I downloaded XNA 3, I was one step closer to a successful build.   In my case my build was still failing due to a post build event.  The post build event appears to be intended to copy the files from SpiderMonkey into the bin with the rest of the project.   Everything appeared to be correct there, but for some reason it was still failing. As a work around I removed the post build event and instead performed that step manually.

With all this said and done I was finally able to convert some C# code over into javascript.   I am not quite to the point where I am actually running the generated code so I am going to leave those instructions for part two of this series.

So far this is all that I know about JSIL.  Look for a second post on converting a game.


getimoliver said…
Hey Fernando,

I'm at the same point you are - I have .js converted files, but no idea how to "run" them!

I've recorded what I have so far here:

Let me know if you get to part 2 sometime.
getimoliver said…
Hey Fernando,

I'm at the same step you are - I have converted .js files but no idea how to "run" them as a game.

I've recorded what I have so far here:

Let me know if you write part 2!

Popular posts from this blog

Simple Example of Using Pipes with C#

Difference Between Adapter and Bridge Design Patterns

IoC Container Vs. Service Locator