From 522f4e841ddaf151a4774ef551db671df565d5aa Mon Sep 17 00:00:00 2001 From: liabru Date: Sun, 24 Jan 2021 22:19:49 +0000 Subject: [PATCH] improve stack examples with exact contact --- examples/circleStack.js | 2 +- examples/compoundStack.js | 2 +- examples/pyramid.js | 2 +- examples/stack.js | 2 +- examples/stress.js | 2 +- examples/stress2.js | 2 +- examples/wreckingBall.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/circleStack.js b/examples/circleStack.js index 4e56bfd..6ead24a 100644 --- a/examples/circleStack.js +++ b/examples/circleStack.js @@ -32,7 +32,7 @@ Example.circleStack = function() { Runner.run(runner, engine); // add bodies - var stack = Composites.stack(100, 185, 10, 10, 20, 0, function(x, y) { + var stack = Composites.stack(100, 600 - 21 - 20 * 20, 10, 10, 20, 0, function(x, y) { return Bodies.circle(x, y, 20); }); diff --git a/examples/compoundStack.js b/examples/compoundStack.js index d534585..cc11a1d 100644 --- a/examples/compoundStack.js +++ b/examples/compoundStack.js @@ -35,7 +35,7 @@ Example.compoundStack = function() { // add bodies var size = 50; - var stack = Composites.stack(100, 280, 12, 6, 0, 0, function(x, y) { + var stack = Composites.stack(100, 600 - 17 - size * 6, 12, 6, 0, 0, function(x, y) { var partA = Bodies.rectangle(x, y, size, size / 5), partB = Bodies.rectangle(x, y, size / 5, size, { render: partA.render }); diff --git a/examples/pyramid.js b/examples/pyramid.js index dd4482d..bd5e0d5 100644 --- a/examples/pyramid.js +++ b/examples/pyramid.js @@ -32,7 +32,7 @@ Example.pyramid = function() { Runner.run(runner, engine); // add bodies - var stack = Composites.pyramid(100, 258, 15, 10, 0, 0, function(x, y) { + var stack = Composites.pyramid(100, 605 - 25 - 16 * 20, 15, 10, 0, 0, function(x, y) { return Bodies.rectangle(x, y, 40, 40); }); diff --git a/examples/stack.js b/examples/stack.js index 008b368..94c079e 100644 --- a/examples/stack.js +++ b/examples/stack.js @@ -32,7 +32,7 @@ Example.stack = function() { Runner.run(runner, engine); // add bodies - var stack = Composites.stack(200, 380, 10, 5, 0, 0, function(x, y) { + var stack = Composites.stack(200, 606 - 25.25 - 5 * 40, 10, 5, 0, 0, function(x, y) { return Bodies.rectangle(x, y, 40, 40); }); diff --git a/examples/stress.js b/examples/stress.js index 5888981..b463d9d 100644 --- a/examples/stress.js +++ b/examples/stress.js @@ -31,7 +31,7 @@ Example.stress = function() { Runner.run(runner, engine); // scene code - var stack = Composites.stack(90, 50, 18, 15, 0, 0, function(x, y) { + var stack = Composites.stack(90, 600 - 25 - 15 * 35, 18, 15, 0, 0, function(x, y) { return Bodies.rectangle(x, y, 35, 35); }); diff --git a/examples/stress2.js b/examples/stress2.js index b0ed57d..19be24e 100644 --- a/examples/stress2.js +++ b/examples/stress2.js @@ -31,7 +31,7 @@ Example.stress2 = function() { Runner.run(runner, engine); // scene code - var stack = Composites.stack(100, 120, 25, 18, 0, 0, function(x, y) { + var stack = Composites.stack(100, 600 - 25 - 18 * 25, 25, 18, 0, 0, function(x, y) { return Bodies.rectangle(x, y, 25, 25); }); diff --git a/examples/wreckingBall.js b/examples/wreckingBall.js index 8a90316..f4086b0 100644 --- a/examples/wreckingBall.js +++ b/examples/wreckingBall.js @@ -34,7 +34,7 @@ Example.wreckingBall = function() { // add bodies var rows = 10, - yy = 600 - 21 - 40 * rows; + yy = 600 - 25 - 40 * rows; var stack = Composites.stack(400, yy, 5, rows, 0, 0, function(x, y) { return Bodies.rectangle(x, y, 40, 40);