0.3.0 • Published 4 years ago

kaboomjs v0.3.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
4 years ago

Kaboom Logo

Kaboom.js is a JavaScript library that helps you make games fast and fun!

Check out our official website!

Example

<script src="https://kaboomjs.com/lib/0.5.0/kaboom.js"></script>
<script type="module">

// initialize kaboom context
const k = kaboom();

// define a scene
k.scene("main", () => {

	// add a text at position (100, 100)
	k.add([
		k.text("ohhimark", 32),
		k.pos(100, 100),
	]);

});

// start the game
k.start("main");

</script>

You can paste this directly into an html file and start playing around!

Usage

<script src="https://kaboomjs.com/lib/@version/kaboom.js"></script>

All available version tags can be found in CHANGELOG.md, or Github releases.

Special Version Tags:

  • dev: current master with the newest unreleased features / fixes, but not guaranteed to be stable
  • latest: latest release

The script will expose a window.kaboom function to initialize a kaboom context, returning an object containing

const k = kaboom();

k.init();
k.scene(...);
k.start(...);

You can also import all functions to global namespace by giving a global flag

kaboom({
	global: true,
});

init();
scene(...);
start(...);

Kaboom also provide ES module and commonJS module exports with .mjs and .cjs, e.g,

import kaboom from "https://kaboomjs.com/lib/dev/kaboom.mjs";

Dev

  1. npm run dev to watch & build lib
  2. go to http://localhost:8000/examples
  3. edit examples in examples/ to test
  4. make sure not breaking any existing examples

Misc

Featured on Console 50

0.5.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago