Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jarEl.src = `https://cdn.streamlabs.com/static/tip-jar/jars/glass-pint.png`;
- /* The code I'm using to try and get a circular collision box - NOT WORKING */
- cupBase[1] += 10;
- circleBody = new p2.Body({ mass: 0, position: [cupBase[0], cupBase[1]] });
- circleShape = new p2.Box({ width: 140, height: 30 });
- circleShape.material = this.materials.wall;
- circleBody.addShape(circleShape);
- this.world.addBody(circleBody);
- this.world.addBody(createCircleBody(0, 40);
- /* The base code that works
- cupBase[1] += 10;
- boxBody = new p2.Body({ mass: 0, position: [cupBase[0], cupBase[1]] });
- boxShape = new p2.Box({ width: 140, height: 30 });
- boxShape.material = this.materials.wall;
- boxBody.addShape(boxShape);
- this.world.addBody(boxBody);
- this.world.addBody(this.createRectangleBody([cupBase[0] + 68, cupBase[1] + 133], 300, 30, 85));
- this.world.addBody(this.createRectangleBody([cupBase[0] - 68, cupBase[1] + 133], 300, 30, -85));
- */
Add Comment
Please, Sign In to add comment