ykdojo / kaboom

JavaScript game library

Home Page:https://kaboomjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo

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

website

Example

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

// make kaboom functions global
kaboom.global();

// init kaboom context
init();

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

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

});

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

</script>

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

Usage

the recommended way is to download a local copy of the library and use it directly, the source should be easy to read and modify (still in progress of documenting the source)

you can also use CDN

<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 containing all the kaboom functions, you can either do

kaboom.global();

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

to import all kaboom functions to global namespace, or use namespaced kaboom functions to avoid any naming collision

const k = kaboom;

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

Dev

use examples to test / add features

  1. npm run site
  2. go to http://localhost:8000/examples
  3. edit examples in site/pub/examples/

About

JavaScript game library

https://kaboomjs.com

License:Other


Languages

Language:JavaScript 98.9%Language:CSS 1.1%