A browser port of the MonoGame Platformer2D sample, using FNA (an open-source implementation of the XNA libraries), SDL2, Emscripten, and JSIL.
- You'll need to have JSIL checked out in a folder next to this one, so that
SampleFNA\..\JSIL
is valid. - You also need to clone the FNA fork next to this repository, so that
SampleFNA\..\FNA
is valid. In the future we hope to merge this support into trunk FNA (and add it as a submodule to this sample). - Building the project in Visual Studio will automatically invoke
JSILc
to generate the appropriate JavaScript files. Check the build output window to see the results. (You can also run thebuildJSIL.bat
file directly.) - You will need the latest MonoGame SDK installed if you want to compile the sample's content into the
XNB
files used by the sample. Once you have it installed, double-click thePlatformer2D\Content\Platformer2d.mgcb
file to open the content build tool and Build to create the necessary content files. This only needs to be done once. - For Song playback to work, you'll need to convert
Music.wma
into an ogg vorbis file calledMusic.ogg
, next to theMusic.xnb
file created by the content builder above. Sadly, the content builder cannot do this for us. (JSILc may acquire the ability to do this in the future.) - To build
SDL2.js
install the latest Emscripten SDK and runbuildSDL.bat
. - To build
soft_oal.js
install the latest Emscripten SDK and runbuildOpenAL.bat
- For Song playback to work you will need to hand-edit
soft_oal.js
by searching forvar AL={contexts:
and replacing it withvar AL=Module["OpenAL"]={contexts:
. This is a workaround for an open Emscripten issue.
- For Song playback to work you will need to hand-edit
Open index.html
in a browser. However, this will only work when loaded from a web server, because modern web browsers deny access to resources over the file://
protocol.
- The FNA and Platformer2D ports are the work of Katelyn Gadd and Jaiden Mispy, aided by partial sponsorship from the Mozilla Foundation.
- The Platformer2D sample is derived from the MonoGame Platformer2D sample.
- FNA is the work of Ethan Lee and numerous other authors.