Skip to content

h4k1m0u/platformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Platform game

The player needs to eliminate all his enemies to win the game

Assets

Credit

Usage

  • Run development server: npm run start
  • Deployment: npm run build
  • After deployment, and to access the dist/index.html file, an http server is needed to serve sprite images from the hard-drive: python3 -m http.server

Prerequisites

Create a package.json

This file will list all the dependencies:

npm init -y

Webpack

Webpack is module bundler for merging js/css files into one (optimal for browsers), and for automating the build process (like cmake). Webpack-cli is needed since webpack 4.

npm install --save-dev webpack webpack-cli

Webpack-dev-server works in-memory to refresh the browser automatically when files are modified:

npm install --save-dev webpack-dev-server

html-webpack-plugin is needed to generate automatically an index.html file:

npm install --save-dev html-webpack-plugin

file-loader is needed to copy images automatically on build:

npm install --save-dev file-loader

Three.js and its performance monitor

npm install three stats.js --save

ESLint

Run linter on javascript source file:

npm install eslint --save-dev
npx eslint --init
npx eslint src/app.js

Documentation

Run jsdoc to generate documentation on javascript source file:

npm install --save-dev jsdoc
npx jsdoc src/app.js

Vim

./install.py --ts-completer

If it was already installed, you need to force it to use TSServer instead of Tern by deleting the following folder:

third_party/ycmd/third_party/tern_runtime/node_modules
  • Finally, check that YouCompleteMe (YCM) is running correctly by looking at the logs whose paths are printed with:
:YcmDebugInfo

Tutorials

  • Short tutorial to get started with webpack.
  • A more comprehensive tutorial about project structure with webpack.

Icons

Icons are available on this website on a permissive license.