piemadd / kablam

💥 JavaScript game library

Home Page:https://kaboomjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kablam Logo

Kablam.js is a fork of Kaboom.js

This fork has some principles which really differentiate it from the main Kaboom library:

  • Improved Pysics Engine:
    • The physics/collisions are a bit dodgy on Kaboom, which is the main reason I made this fork.
  • No NFT Stuff:
    • They aren't good for the environment, I don't like them, on top of the fact that their use is limited, at most.
  • Separated assets, lubrarym and everything else:
    • In kaboom, the library, website, demos, and assets are all in one massive repository. If it isn't obvious, this is a bit of an issue in terms of performance, as downloading a whole megabyte to a machine to run a simple game is very :|.
  • Better FPS:
    • This is on the backburner right now, but general performance improvements are to come, I just need to figure out in what areas these will occur.
  • Greater Control:
    • This library gives you greater control over the elements at hand. No more creating something and theres no way to get resulting element. For example, you'll actually be able to get the audio context from a played audio file.

Examples

I've removed the examples section from the readme of this fork, mainly as I feel it will become neglected, along with the fact that any Kaboom.js code should work A-OK.

Usage

NPM

$ npm install kablam
import kaboom from "kablam";

kaboom();

add([
    text("oh hi"),
    pos(80, 40),
]);

also works with CommonJS

const kaboom = require("kablam");

Note that you'll need to use a bundler like esbuild or webpack to use Kaboom with NPM

Browser CDN

This exports a global kaboom function

<script src="https://unpkg.com/kablam/dist/kablam.js"></script>
<script>
kaboom();
</script>

or use with es modules

<script type="module">
import kaboom from "https://unpkg.com/kablam/dist/kablam.mjs";
kaboom();
</script>

works all CDNs that supports NPM packages, e.g. jsdelivr, skypack

Dev

  1. npm run setup to setup first time (installing dev packages)
  2. npm run dev to watch & build lib and the website (the website might take some time to build for the first time)
  3. go to http://localhost:3000/play
  4. edit demos in demo/ to test
  5. make sure not to break any existing demos

also check out CONTRIBUTION.md

Community

Github Discussions

Misc

About

💥 JavaScript game library

https://kaboomjs.com

License:MIT License


Languages

Language:JavaScript 76.3%Language:TypeScript 23.7%