chain parameters

This commit is contained in:
landgreen
2020-08-30 14:17:05 -07:00
parent a0db3ffa12
commit ce96cd37ef
3 changed files with 6 additions and 7 deletions

View File

@@ -611,7 +611,7 @@ const game = {
if (game.isCommunityMaps) { if (game.isCommunityMaps) {
level.levels.push("stronghold"); level.levels.push("stronghold");
level.levels.push("basement"); level.levels.push("basement");
level.levels.push("newLevel"); // level.levels.push("newLevel");
} }
level.levels = shuffle(level.levels); //shuffles order of maps level.levels = shuffle(level.levels); //shuffles order of maps
level.levels.unshift("bosses"); //add bosses level to the end of the randomized levels list level.levels.unshift("bosses"); //add bosses level to the end of the randomized levels list

View File

@@ -3841,7 +3841,7 @@ const level = {
} }
} }
}, },
chain(x, y, len = 15, radius = 20) { chain(x, y, len = 15, radius = 20, stiffness = 0.4, damping = 0.01) {
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
body[body.length] = Bodies.polygon(x, y + 2 * radius * i, 12, radius, { body[body.length] = Bodies.polygon(x, y + 2 * radius * i, 12, radius, {
inertia: Infinity inertia: Infinity
@@ -3851,8 +3851,8 @@ const level = {
consBB[consBB.length] = Constraint.create({ consBB[consBB.length] = Constraint.create({
bodyA: body[body.length - i], bodyA: body[body.length - i],
bodyB: body[body.length - i - 1], bodyB: body[body.length - i - 1],
stiffness: 0.4, stiffness: stiffness,
damping: 0.01 damping: damping
}); });
} }
cons[cons.length] = Constraint.create({ //pin first block to a point in space cons[cons.length] = Constraint.create({ //pin first block to a point in space
@@ -3861,8 +3861,8 @@ const level = {
y: y - radius y: y - radius
}, },
bodyB: body[body.length - len], bodyB: body[body.length - len],
stiffness: 0.4, stiffness: stiffness,
damping: 0.01 damping: damping
}); });
}, },
}; };

View File

@@ -1,5 +1,4 @@
mod: rail road ties - nails are 40% bigger
************** TODO - n-gon ************** ************** TODO - n-gon **************