1.0.4 • Published 4 years ago

matterjs-boilerplate v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

How to use:

  • import matter js into your project
import Matter from 'matter-js'
  • import matterjs-boilerplate
import { matterBoilerplate } from './MatterBoilerplate'
  • start a matterjs project after one line, de-structuring the constants/variables that we'll need access to in our main project file, passing in width and height parameters
let {
	engine, render, runner, world, mouse, mouseConstraint
} = matterBoilerplate(width [int], height [int])
  • runs all the necessary setup of the engine, render, and runner and abstracts it away from the main file
  • you can access these important variables via the line above ^^
  • now, you can start adding your physics bodies!
let rectangle = Matter.Bodies.rectangle(0, 0, 100, 200)

World.add(world, body1)
1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago