百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
K

kaboom

> 编程语言
开源

JavaScript 游戏库

2.7K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

JavaScript 游戏库

Notice

Replit no longer maintains Kaboom. You may be interested in the community fork KaPlay.

Kaboom

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

Start playing around with it in the Kaboom Playground

Examples

// initialize context
kaboom()

// define gravity
setGravity(2400)

// load a sprite called "bean"
loadSprite("bean", "sprites/bean.png")

// compose the player game object from multiple components and add it to the game
const bean = add([
    sprite("bean"),
    pos(80, 40),
    area(),
    body(),
])

// press space to jump
onKeyPress("space", () => {
    // this method is provided by the "body" component above
    bean.jump()
})

Kaboom uses a powerful component system to compose game objects and behaviors.

// add a game obj to the scene from a list of component
const player = add([
    // it renders as a sprite
    sprite("bean"),
    // it has a position
    pos(100, 200),
    // it has a collider
    area(),
    // it is a physical body which will respond to physics
    body(),
    // it has 8 of health
    health(8),
    // or give it tags for easier group behaviors
    "player",
    "friendly",
    // plain objects fields are directly assigned to the game obj
    {
        dir: vec2(-1, 0),
        dead: false,
        speed: 240,
    },
])

Blocky imperative syntax for describing behaviors

…

Usage

Start a Project With create-kaboom

The fastest way to start a Kaboom game is with create-kaboom

$ npm init kaboom mygame

This will create a directory called mygame for you, containing all the files we need

$ cd mygame
$ npm run dev

Then open http://localhost:5173 and edit src/game.js

Install as NPM Package

$ npm install kaboom
import kaboom from "kaboom"

kaboom()

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

also works with CommonJS

const kaboom = require("kaboom")

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/kaboom@3000/dist/kaboom.js"></script>
<script>
kaboom()
</script>

or use with es modules

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

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

Documentation

  • v3000: https://kaboomjs.com/
  • v2000: https://2000.kaboomjs.com/
  • v0.5.0: https://legacy.kaboomjs.com/

Dev

  1. npm install to install dev packages
  2. npm run dev to start dev server
  3. go to http://localhost:8000/ and pick an example
  4. edit examples in examples/ to test

Check out CONTRIBUTION.md for full info.

Community

  • Discord Server
  • GitHub Discussions
  • Twitter

Games

Collection of games made with Kaboom, selected by Kaboom, here.

  • on Itch.io
  • on Replit
  • on Newgrounds

Misc

  • This project has no relation to Activision's game Kaboom!
  • Thanks to lajbel for help building the Kaboom community
  • Thanks to abrudz for the amazing APL386 font
  • Thanks to Polyducks for the amazing kitchen sink font font
  • Thanks to 0x72 for the amazing Dungeon Tileset
  • Thanks to Kenney for the amazing 1-Bit Platformer Pack
  • Thanks to mulfok for the amazing mulfok32 color palette
  • Find bitmap fonts: Oldschool PC Font
  • Featured on Console 50
  • Thanks to Umayr for kindly offering the "kaboom" npm package name
  • Please buy fireworks on kaboom.com
  • How to do a KABOOM on a Trampoline

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •v3000: https://kaboomjs.com/
  • •v2000: https://2000.kaboomjs.com/
  • •v0.5.0: https://legacy.kaboomjs.com/
  • •Discord Server
  • •GitHub Discussions
  • •on Itch.io
  • •on Replit
  • •on Newgrounds
  • •This project has no relation to Activision's game Kaboom!)
  • •Thanks to lajbel for help building the Kaboom community

> 标签

TypeScriptfungamegamedevjavascript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言