Skip to content

burnoutjs/burnout-keyboard-controls-plugin

Repository files navigation

burnout-keyboard-controls-plugin

🎮 Provide keyboard controls for burnout game engine.

Keyboard map

Features

  • Map the up key for burnout control.up().
  • Map the down key for burnout control.down().
  • Map the left key for burnout control.left().
  • Map the right key for burnout control.right().

How to use?

Tip: First, install and config burnout.js game engine.

Install

$ yarn add burnout-keyboard-controls-plugin

Setup

ES6/ECMAScript 2015 module:

Tip: Use Webpack (or similar module bundler) to manage the components.

import burnoutKeyboardControlsPlugin from 'burnout-keyboard-controls-plugin';

CommonJS module:

Tip: Use Browserify (or similar module bundler) to manage the components.

const burnoutKeyboardControlsPlugin = require('burnout-keyboard-controls-plugin');
Define your plugin
// ...

burnout.defineControlsPlugin(burnoutKeyboardControlsPlugin);

// ...

Development

Getting started

Clone this repository and install its dependencies:

$ git clone https://github.com/burnoutjs/burnout-keyboard-controls-plugin.git
$ cd burnout-keyboard-controls-plugin
$ yarn

Build

Builds the library to dist:

$ yarn build

Builds the library, then keeps rebuilding it whenever the source files change using rollup-watch:

$ yarn dev

Code Style

Follow the JS Code Style Guide by Afonso Pacifer.

All code style are automatic validate with ESLint:

Tests

Run all unit tests:

$ yarn test

Versioning

To keep better organization of releases we follow the Semantic Versioning 2.0.0 guidelines.

Contributing

Want to contribute? Follow these recommendations.

History

See Releases for detailed changelog.

License

MIT License © Afonso Pacifer