craters.js

1.3.2 • Public • Published

Craters.js

npm bundle size es modules

craters.js logo craters.js documentation

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.

Package Sidebar

Install

npm i craters.js

Weekly Downloads

8

Version

1.3.2

License

ISC

Unpacked Size

2.57 MB

Total Files

85

Last publish

Collaborators

  • swashvirus