http://kripken.github.io/emscripten-site/
如果能一键把 cocos2d-Lua 项目生成小游戏 )
506 # Get the emsdk repo
507 git clone https://github.com/juj/emsdk.git
508 cd emsdk/
509 ls
510 git pull
511 # Download and install the latest SDK tools.
512 ./emsdk install latest
513 # Make the "latest" SDK "active" for the current user. (writes ~/.emscripten file)
514 ./emsdk activate latest
515 # Activate PATH and other environment variables in the current terminal
516 source ./emsdk_env.sh
517 ls
518 vi hello.c
531 emcc hello.c -o hello.html
534 node hello.js
535 python -m SimpleHTTPServer 8080 # 必须启动一个 http 服务器
536 emcc emscripten/1.38.12/tests/hello_world_sdl.cpp -o hello_sdl.html
537 emcc emscripten/1.38.12/tests/glfw3.c -o glfw.html
538 emcc emscripten/1.38.12/tests/glfw_events.c -o glfw_e.html
539 emcc emscripten/1.38.12/tests/glfw_minimal.c -o glfwmini.html
540 emcc -O2 emscripten/1.38.12/tests/hello_world_sdl.cpp -o hello_sdl.html
544 emcc -O2 emscripten/1.38.12/tests/hello_world.c -o hello.html
$ du hello.js hello.wasm
56 hello.js
24 hello.wasm
环境还是很好搭建的,仔细阅读文档就好了。
https://github.com/emscripten-ports/Cocos2d 这个项目维护到了 2017 年。
END
网友评论