chain parameters
This commit is contained in:
@@ -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
|
||||||
|
|||||||
10
js/level.js
10
js/level.js
@@ -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
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user