myst.js is a lightweight HTML5 game development toolkit intended for 2D game development.
Version 0.9.8
- Single file (minified: 16.9KB) with zero external dependencies
- Supports all modern browsers (IE11/Edge/Firefox/Opera/Chrome/Safari)
- Easy to use API - most features are simple, reusable classes
- State based
- Asset management
- Keyboard and mouse or touch input
- And more!
Please see HOWTO.md. See documentation for API reference.
// create a game state
let myState = new myst.State();
// draw some shapes
myState.draw = function() {
this.surface.clear();
this.paint.rectFill(10, 10, 50, 20, 'red');
this.paint.circleFill(100, 30, 20, 'blue');
};
// setup game
let myGame = new myst.Game({
canvasId: 'myCanvasId', // canvas element id
state: myState, // initial game state
simpleLoop: true // just draw and never call myState.update()
});
// run game on window load
window.addEventListener('load', myGame.run);
- Utils (myst.UI, myst.level, ...)
- Demos
Copyright (c) 2020 Danijel Durakovic
MIT License