Skip to content

Commit

Permalink
improve stack examples with exact contact
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 24, 2021
1 parent 839f7d9 commit 522f4e8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/circleStack.js
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/compoundStack.js
Expand Up @@ -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 });

Expand Down
2 changes: 1 addition & 1 deletion examples/pyramid.js
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/stack.js
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/stress.js
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/stress2.js
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/wreckingBall.js
Expand Up @@ -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);
Expand Down

0 comments on commit 522f4e8

Please sign in to comment.