🎮 v0.2.0-alpha • Open Source

Build Amazing 2D Games with KernelPlay.js

A lightweight JavaScript game engine inspired by Unity's Entity-Component architecture. Perfect for learning, prototyping, and building small-to-medium 2D games.

11 stars on GitHub
Active Development
MIT License

Everything You Need to Build Games

Powerful features that make game development simple and enjoyable

Entity-Component System

Unity-inspired ECS architecture for flexible and modular game object composition.

Multiple Renderers

Canvas 2D, WebGL 2D, and Three.js 3D rendering pipelines for maximum flexibility.

Physics Engine

Built-in 2D/3D physics with collision detection, rigidbodies, and realistic movement.

Input System

Comprehensive keyboard and mouse input handling with easy-to-use APIs.

Scene Management

Organize your game with scenes and seamlessly switch between levels.

Lightweight

Small footprint, no dependencies (except Three.js for 3D), fast load times.

Get Started in Minutes

Install via npm or use CDN - your choice!

NPM Install

bash
npm install kernelplay-js --save

CDN Import

html
<script type="importmap">
{
  "imports": {
    "kernelplay-js": "https://cdn.jsdelivr.net/npm/kernelplay-js@latest/dist/kernelplay.es.js"
  }
}
</script>

Hello World Example

main.js
import { Game, Scene, Entity } from "kernelplay-js";
import { TransformComponent, BoxRenderComponent } from "kernelplay-js";

class MyScene extends Scene {
  init() {
    const box = new Entity();
    box.addComponent("transform", new TransformComponent({
      position: { x: 300, y: 200 }
    }));
    box.addComponent("renderer", new BoxRenderComponent({color:"red"}));
    
    this.addEntity(box);
  }
}

class MyGame extends Game {
  init() {
    const scene = new MyScene("Main");
    this.sceneManager.addScene(scene);
    this.sceneManager.startScene("Main");
  }
}

new MyGame({ width: 800, height: 600, fps: 60 }).start();

Ready to Build Your Game?

Join developers creating amazing games with KernelPlay.js