diff --git a/Compile-your-game-for-Web-(HTML5).md b/Compile-your-game-for-Web-(HTML5).md index e354388..602e339 100644 --- a/Compile-your-game-for-Web-(HTML5).md +++ b/Compile-your-game-for-Web-(HTML5).md @@ -15,11 +15,13 @@ _NOTE: If a newer preconpiled SDK version (newer than sdk-1.34.1-64bit) is avail Before compiling your game, raylib library must be recompiled for HTML5. By default, when you install raylib using the Windows Installer, an already pre-compiled raylib HTML5 version is found in `C:\raylib\raylib\src\libraylib.bc`. Notepad++ uses this version but you can regenerate it just recompiling raylib for web (in case you have modified raylib sources or you updated it with GitHub develop branch sources). ###Preparing your raylib game for web + To compile your game for web, code must be slightly adapted. Basically it implies moving all your Update and Draw code to an external function. The reason for that is the way web games work within a browser; the browser needs to control the game loop and just allow and Update-Draw cycle when the tab is active or browser is not minimized. To see how code should be refactored to fit compilation for web, check [core_basic_window_web.c](https://github.com/raysan5/raylib/blob/master/examples/core_basic_window_web.c) example. ###Compiling raylib game + Just open your raylib web-prepared game code and run the Notepad++ script named `raylib_compile_emscripten`. Note that script defines some paths to the required tools, check you are using the correct versions of those tools! Note also that required resources should be embedded into a .data file using the compiler parameter `--preload-file filename.ext` or `--preload-file folder`.