๐ KernelPlay-JS v0.5.0 is now released!
This release is a pretty important milestone for the project. Weโve been working on improving how games handle input, and v0.5.0 introduces a new Unified Input Manager for keyboard, mouse, gamepad, and touch input.
The idea is simple: game code shouldnโt need to care where an input came from.
๐ฎ One API for Game Input
With the new Input API, common gameplay code can stay clean and device-independent:
import { Input } from "kernelplay-js";
update(dt) {
const x = Input.getAxis("horizontal");
const y = Input.getAxis("vertical");
this.rb.addForce(800 * x, 800 * y);
if (Input.wasPressed("jump")) {
this.jump();
}
if (Input.isPressed("attack")) {
this.attack();
}
}
Instead of checking individual keyboard keys, mouse buttons, gamepad buttons, or touch events throughout your game code, you can work with actions and axes.
That makes gameplay systems much easier to maintain.
โ๏ธ Two Ways to Configure Input
v0.5.0 supports both programmatic input registration and declarative JSON configuration.
For code-driven projects:
Input.registerAction("shoot", {
keys: [KeyCode.Z, KeyCode.X],
buttons: [GamepadButton.X, GamepadButton.RB]
});
For projects that need external configuration or runtime rebinding:
{
"actions": {
"jump": {
"keys": ["Space", "ArrowUp"],
"buttons": ["A", "B"]
},
"go": {
"keys": ["x", "z"],
"buttons": ["DPadRight"]
}
}
}
This gives developers more flexibility when building configurable control schemes, key-binding systems, or different control profiles.
๐น๏ธ Why This Matters
Input handling is one of those systems that can start simple and quickly become messy as a game grows.
You might begin with:
if (keyboard.isDown("ArrowRight")) {
// move
}
Then later you need keyboard support, controllers, touch controls, remapping, multiple control schemes, and so on.
The Unified Input Manager provides a common layer between those devices and your gameplay code.
The goal is to let gameplay systems think in terms of actions like jump, attack, and move, rather than individual physical inputs.
๐ฆ KernelPlay-JS v0.5.0
This release is part of the v0.5.x development cycle, and there is still plenty to improve.
Some areas Iโm interested in exploring next include better runtime rebinding, controller support improvements, input profiles, and additional input configuration options.
If you're building games with JavaScript, I'd really appreciate feedback on the API and the overall direction of the input system.
โญ Repository: https://github.com/Soubhik1000/kernelplay
๐ Documentation: https://github.com/Soubhik1000/kernelplay/blob/master/README.md
Give it a try, break something, tell me what feels wrong, and let me know what you'd like to see in the next v0.5.x release!
Thanks to everyone following the project so far. Thereโs still a lot to build, but KernelPlay-JS is moving forward one system at a time. ๐
Top comments (1)
Thanks for checking out KernelPlay-JS!
If you're interested in following development, testing upcoming features, or sharing feedback, feel free to join the community on Discord:
discord.gg/bHfe96EnNR
Everyone is welcome, whether you're a game developer, JavaScript enthusiast, or just curious about the project. I'd love to hear your suggestions and ideas as KernelPlay-JS continues to grow.