Large diffs are not rendered by default.

@@ -1,19 +1,21 @@
var animationController = {
dict: {
87: veil,
69: ufo,
79: dotted_spiral,
80: clay,
// asdf
84: highRise,
83: circlePop, // S
81: audienceShapes, // Q
//86: sqaureExplode, //V
70: horizontalLines, // D
65: strike,
82: squiggle,
68: flash,
"circle": centerCircle
"veil": veil,
"ufo": ufo,
"suspension": suspension,
"highRise": highRise,
"starExplode": starExplode,
"clay": clay,
"circlePop": circlePop,
"horizontalLines": horizontalLines,
"strike": strike,
"squiggle": squiggle,
"flash": flash,
"dotted_spiral": dotted_spiral,
"centerCircle": centerCircle,
"circle": centerCircle,
// THIS ONE IS WEIRD
"audienceShapes": audienceShapes
},
trigger: function (id, wasPhone) {
var sound = soundController.dict[id];
@@ -23,11 +25,6 @@ var animationController = {
// we want them to overlap
sound.play();
}
if(id === 81){
console.log("I'm in")
var x = animation("square", randomColor());
x.start();
}
else if (animation) {
if (animation.playing()) {
animation.clear();
@@ -277,8 +277,8 @@ var suspension = (function() {
var playing = false,
callback = _.identity,
amount = 16,
r1 = min_dimension * 12 / 900,
r2 = min_dimension * 20 / 900,
r1 = min_dimension * 40 / 900,
r2 = min_dimension * 60 / 900,
theta, deviation, distance = height,
destinations = [],
circles = _.map(_.range(amount), function(i) {
@@ -424,4 +424,103 @@ var circlePop = (function(){
playing: function() { return playing; },
};
return exports;
})();
})();

var horizontalLines = (function() {

var playing = false;
var callback = _.identity;

var distance = min_dimension * 0.5;

var line = two.makeLine(-width, center.y - center.y * .25, 0, center.y - center.y * .25);
var line2 = two.makeLine(width, center.y + center.y * .25, 2*width, center.y + center.y * .25);

line.noFill().stroke = "#333";
line.visible = true;

line2.noFill().stroke = "#333";
line2.visible = true;

var start = function(onComplete, silent) {
line.visible = true;
playing = true;
animate_in.start();
animate_in2.start();
if (_.isFunction(onComplete)) {
callback = onComplete;
}
};

start.onComplete = reset;

var animate_in = new TWEEN.Tween(line.translation)
.to({
x: 2*width + width/2
}, duration * 0.7)
.easing(Easing.Circular.In)
.onComplete(function() {
//animate_out.start();
start.onComplete();
callback();
});

var animate_in2 = new TWEEN.Tween(line2.translation)
.to({
x: -2*width + width/2
}, duration * 0.7)
.easing(Easing.Circular.In)
.onComplete(function() {
//animate_out.start();
start.onComplete();
callback();
});

var animate_out = new TWEEN.Tween(line)
.to({
beginning: 1.0
}, duration * 0.25)
.easing(Easing.Circular.Out)
.onComplete(function() {
start.onComplete();
callback();
});

var exports = {
start: start,
clear: reset,
playing: function() { return playing; },
};

var a = {
x: 0, y: 0
};
var b = {
x: 0, y: 0
};

var rando, theta, pct, i, p;
function reset() {

playing = false;
rando = Math.random();

line.linewidth = Math.round(rando * 5) + 7;
line2.linewidth = Math.round(rando * 5) + 7;
line.translation.set(-width + width/2, line.translation.y);
line2.translation.set(width + width/2, line2.translation.y);

line.ending = line.beginning = 0;
line.ending = 1;
line.visible = true;
line2.visible = true;

animate_in.stop();
animate_out.stop();
}

reset();

return exports;

})();

Large diffs are not rendered by default.

@@ -9,5 +9,5 @@ socket.on("acceleration_input", function(msg) {

socket.on("audience_shape_input", function(msg) {
console.log(msg.shape);
animationController.dict[81](msg.shape, msg.color).start();
});
animationController.dict["audienceShapes"](msg.shape, msg.color).start();
});