How to install Emscripten
Dependencies: CMake, gcc and Python.
On Unix-based systems:
Test with the command:
If using Windows, see here.
Example of use
Suppose you have this code:
Save this image:
Compile and run:
Need SDL2 installed!
Now let’s transform this code to compile for the Web.
Modify the code above and make it look like this:
Compile with the following command:
Create a new
index.html file and insert this content:
If the file already exists, remove all content from it and paste this code inside.
And now view and use in your browser!
After running this command the game will automatically open in your default browser.
For more information visit the official website of Emscripten: