Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

craters.js

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

craters.js

A Compact Game Engine that helps you build fast, modern HTML5 Games

  • 1.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

craters.js ☄️

npm bundle size es modules

craters.js logo craters.js documentation

Short description

craters.js is a simple to use micro game engine both lightweight and portable so minimal that it's just 1.5kb in size! zipped and minified. in it, it includes all basics you need to get a game up and running in a few lines of code leaving enough room for the game logic. suitable for js13kgames competition

Demo sample game

features ✨
  • Changelog Read changelog

  • ES modules reduces bundle size

  • Sound.js sound system loads sounds methods

  • Sprite.js a sprite system

  • Loader.js file loading utility

  • Entity.js Entity base class

  • Game.js Game base class

structure

game is a method which creates an instance of a game world the game and entities both have methods update and render the games instance can have entities and entities can also have their own entities as long as they inherit the craters.entity class

let's make a game 🚀

note the example game is included in the dist folder alternatively you can build it on your own

clone repository

git clone https://github.com/swashvirus/craters.js.git
# import app/craters/craters.js

npm install

npm install craters.js
writing the demo game yourself
'use strict';
import { Game } from './craters/craters.js'

class mygame extends Game {

    render() {
        super.render(this)
        this.context.font = '2em Arial'
        this.context.fillText('It\'s working.️', 65, (this.state.height / 2), (this.state.width))
    }
}

window.game = new mygame('#container', window.innerWidth, window.innerHeight, 60, true)

Submit Issues and Contributions

Keywords

FAQs

Package last updated on 23 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc