MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / constructor

Method constructor

assets/js/Angry_bird.js:25–33  ·  view source on GitHub ↗
(x, y, w, h)

Source from the content-addressed store, hash-verified

23
24class Box {
25 constructor(x, y, w, h) {
26 const options = {
27 restitution: 0.5
28 };
29 this.body = Matter.Bodies.rectangle(x, y, w, h, options);
30 Matter.World.add(world, this.body);
31 this.w = w;
32 this.h = h;
33 }
34
35 show() {
36 const pos = this.body.position;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected