게임 코드 들여다 보기 — 빌드

자바스크립트 게임 코드를 분석하고 있다.

Photo by James Harrison on Unsplash
git clone https://github.com/remvst/ninja.gitcd ninja
make installmake build
▶ make installgit submodule initgit submodule updatebrew install node advancecompmake: brew: Command not foundMakefile:10: recipe for target 'install' failedmake: *** [install] Error 127
git submodule initgit submodule update# brew install node advancecompcd js13k-compiler && git checkout master && git pull && npm install && rm package-lock.json
▶ node build.js[00:00.002] Building main files[00:00.002] Building JS[00:00.002] Building CSS[00:00.002] Building HTML[Error: ENOENT: no such file or directory, open '/home/br/src/ninja/build/index.html'] {errno: -2,code: 'ENOENT',syscall: 'open',path: '/home/br/src/ninja/build/index.html'}
▶ mkdir build
▶ node build.js[00:00.001] Building main files[00:00.002] Building JS[00:00.002] Building CSS[00:00.002] Building HTML[00:00.899] Building ZIP[##################################################] 103%ZIP file size: 13705 bytes (-393 bytes remaining)[##################################################] 100%ZIP file size: 13314 bytes (-2 bytes remaining)[00:00.962] Building debug files[00:00.962] Building CSS[00:00.962] Building HTML[00:00.962] Building JS[00:01.002] Building debug files[00:01.002] Building CSS[00:01.002] Building HTML[00:01.002] Building JS[00:01.229] Done
▶ ls builddebug.html  debug.js  debug_mangled.html  debug_mangled.js  game.zip  index.html
▶ ls srcindex.html  js  style.css
// build.jsconst sequence = [tasks.label('Building JS'),tasks.loadFiles(JS_FILES),tasks.concat(),tasks.macro('optimizeMatrix', optimizeMatrix),tasks.constants(constants),tasks.macro('evaluate'),tasks.macro('nomangle'),tasks.macro('rawFile', rawFile),];
// build.js
if (mangle) {
sequence.push(tasks.mangle(MANGLE_SETTINGS));}if (uglify) {sequence.push(tasks.uglifyES());}
// build.jsbuildDebug({'mangle': false,'suffix': ''}),
const sequence = [tasks.label('Building JS'),tasks.loadFiles(JS_FILES),tasks.concat(),// tasks.macro('optimizeMatrix', optimizeMatrix),// tasks.constants(constants),// tasks.macro('evaluate'),// tasks.macro('nomangle'),// tasks.macro('rawFile', rawFile),];

--

--

JavaScript Developer, https://afrontend.github.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store