Skip to content

Instantly share code, notes, and snippets.

@rubenwardy

rubenwardy/gist:d08745dcacee4687bfb4 Secret

Last active Aug 29, 2015
Embed
What would you like to do?
# replace lines 6 to 20 in scripts/strings.js with this
var ROPE_LENGTH = 0.04; // the equilibirum length of each rope
var ROPE_LENGTH_SQ = ROPE_LENGTH * ROPE_LENGTH; // square of the rope length
var ROPE_SPACING = 0.04; // initial horizontal distance between vertices
var ROPE_MASS = 0.00003; // Mass per length of rope (actually the mass of vertices)
function isPaused() {
return game.paused || game.drawmode;
}
// Start
function init(){
for (var i=0; i<200; i++) {
createVertex(ROPE_SPACING * i, 0, false);
}
points[0].fixed = true;
points[points.length-1].fixed = true;
for (var i=0; i<199; i++) {
joinVertices(i, i + 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.