What is Kontra.js?

Kontra is a lightweight JavaScript gaming micro-library created specifically for the Js13kGames game jam.

The goal of Kontra is not to implement everything you could possibly need to make a game. There are already libraries out there that do that (like Phaser).

Instead, Kontra aims to implement basic game requirements like asset loading, input, the game loop, and spites to keep the library very small and focused. This allows it to be used when your game size is limited (a la Js13k).

Kontra does provide some more advance data structures like object pools and quadtrees that have been fine tuned to be small, fast, and memory efficient.

Kontra prides itself in being:

  • Lightweight: 14.4 kB minified (5.21 kB gzipped) for the entire library.
  • Modular: pick and choose what you want through ES modules. No inter-dependencies.
  • Extensible: everything is customizable and can be extended.
  • Fast: all logic has been removed from the update and render cycles.
  • Memory conscious: takes up as little memory as needed and tries not to be wasteful about the memory it does take up.

Use it When

  • You want to get something up and running fairly quickly.
  • You want a basic structure that is easy to scale and extend.
  • In conjunction with other libraries (like Playground.js).
  • Prototyping.
  • Game jams.

Ready to Get Going?