From 87fbf51c82cd1894c0374dc47061122e9e74ce8e Mon Sep 17 00:00:00 2001 From: liabru Date: Tue, 21 Apr 2015 21:17:38 +0100 Subject: [PATCH] added constraint to Demo.compound --- demo/js/Demo.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/demo/js/Demo.js b/demo/js/Demo.js index fcbbf04..0a48479 100644 --- a/demo/js/Demo.js +++ b/demo/js/Demo.js @@ -137,6 +137,7 @@ size = 150; x = 400; + y = 300; var partC = Bodies.circle(x, y, 30), partD = Bodies.circle(x + size, y, 30), @@ -147,7 +148,13 @@ parts: [partC, partD, partE, partF] }); - World.add(_world, [compoundBodyA, compoundBodyB]); + var constraint = Constraint.create({ + pointA: { x: 400, y: 100 }, + bodyB: compoundBodyB, + pointB: { x: 0, y: -50 } + }); + + World.add(_world, [compoundBodyA, compoundBodyB, constraint]); var renderOptions = _engine.render.options; renderOptions.showAxes = true;