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

Method constructor

assets/js/Angry_bird.js:2–10  ·  view source on GitHub ↗
(x, y, r)

Source from the content-addressed store, hash-verified

1class Bird {
2 constructor(x, y, r) {
3 const options = {
4 restitution: 0.5
5 };
6 this.body = Matter.Bodies.circle(x, y, r, options);
7 Matter.Body.setMass(this.body, this.body.mass * 4);
8 Matter.World.add(world, this.body);
9 this.r = r;
10 }
11
12 show() {
13 const pos = this.body.position;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected