Skip to content

Commit

Permalink
added constraint to Demo.compound
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Apr 21, 2015
1 parent 6679b9c commit 87fbf51
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demo/js/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@

size = 150;
x = 400;
y = 300;

var partC = Bodies.circle(x, y, 30),
partD = Bodies.circle(x + size, y, 30),
Expand All @@ -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;
Expand Down

0 comments on commit 87fbf51

Please sign in to comment.