/bouncing-balls

Bouncing balls - projectiles

Primary LanguageJavaScriptMIT LicenseMIT

Bouncing Balls

Click the canvas to make a ball fire at a random direction and speed subject to gravity and the ball's coefficient of restitution (bounciness).

View the application here.

External libraries

  • Babel: Transpilation to enable modern JS features and language extensions.
  • Webpack: Compiling app to a browser-friendly bundle.
  • Express: Web server.

Architecture

The app is composed of:

  • A JavaScript application compiled and bundled using webpack.
  • An Express server used to serve up the static assets.

Unit testing

Unit testing is done with:

  • Chai: BDD / TDD assertion library for node.
  • Mocha: Feature-rich JavaScript test framework.
  • Sinon: Standalone test spies, stubs and mocks for JavaScript.

To run the unit tests:

npm run test

To run the unit tests in watch mode:

npm run test:w

Installation

$ git clone https://github.com/leighshepperson/bouncing-balls.git
$ cd bouncing-balls

Install the project dependencies using npm:

npm i

Running the project

To debug in the browser using webpack-dev-server:

npm run start

To build for production:

npm run build

To run the production server:

npm run prod