craters.js
v1.3.2
Published
A Compact Game Engine that helps you build fast, modern HTML5 Games
Downloads
24
Maintainers
Readme
Craters.js
Short description
A Compact html5 Game Engine that helps you build fast, modern HTML5 Games
Features ✨
Rigid Body Physics.
QuadTrees Spatial Subdivision
- Broadphase collision detection
Separating Axis Theorem
- Narrow phase collision detection
Tile Engine
- Sprite system
- Renders animated images and solid color.
Additional features
- Emscript6 modules
- Reduces your package size
Additional Modules
Assets module
- Loads images, Audio and json files.
Input module
- Captures keyboard input
Sound module
- Creates instances of audio files a fork of Soundbox.js
Installation
- Clone git repository
git clone https://github.com/swashvirus/craters.js.git
- Npm package
npm install craters.js
Let's make a game 🚀
example games are included in the examples and test directory
Writing an example "it's working" game.
import {Game, Vector} from '../../craters/craters'
class mygame extends Game {
constructor() {
super({
fps: 60,
container: '#container',
size: new Vector(1024, 512)
});
}
render() {
super.render();
// draw some text on the screen
this.context.fillStyle = "#fff";
this.context.font = '2em Arial'
this.context.fillText('It\'s working.️', 65, (this.state.size.y / 2), (this.state.size.x))
}
}
let game = new mygame();
Submit Issues, fixes and Contributions.