Giter Club home page Giter Club logo

kaboom's Introduction

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.4.1/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

We recommend downloading the script and use it directly, the source should be easy to read and modify (documentation is still in progress).

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 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(...);

However, it is possible to use a module version of kaboomjs.

<script type="module" src="script.js"></script>

script.js:

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

const k = kaboom();

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

Using the module version means that there will be no window.kaboom available and kaboom must be imported.

Dev

Use examples to test / add features

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

Misc

Featured on Console 50

kaboom's People

Contributors

slmjkdbtl avatar epicgamer007 avatar rish avatar ykdojo avatar mamamia5x avatar charlestudor avatar johnathonnow avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.