statusbar.innerHTML = 'No websockets :(. This means that you either use <em>Internet Explorer</em> or <em>Android</em>. In both cases, I suggest that you use <ahref="http://www.google.com/chrome/">Chrome</a> or <ahref="http://www.getfirefox.net/">Firefox</a>!';
statusbar.innerHTML = 'No websockets :(. This means that you either use <em>Internet Explorer</em> or <em>Android</em>. In both cases, I suggest that you use <ahref="http://www.google.com/chrome/">Chrome</a> or <ahref="http://www.getfirefox.net/">Firefox</a>!';
}
}
return false;
}
}
function onOpen(evt) {
function onOpen(evt) {
@ -90,10 +97,20 @@
function onMessage(evt) {
function onMessage(evt) {
var ret = JSON.parse(evt.data);
var ret = JSON.parse(evt.data);
var people = ret.people;
var balls = ret.balls;
var balls = ret.balls;
var lines = ret.lines;
var lines = ret.lines;
updateBalls(balls);
updateLines(lines);
setTimeout(function(){
doSend();
}, speed);
}
function updateBalls(balls){
// Because we use transitions for the balls
// we really update them, and only delete the ones which are absent
for(i in balls_online){
for(i in balls_online){
balls_online[i].should_remove = true;
balls_online[i].should_remove = true;
}
}
@ -122,7 +139,10 @@
balls_online.splice(i, 1);
balls_online.splice(i, 1);
}
}
};
};
}
function updateLines(lines){
// Simply delete and redraw them :)
for (var i = svglines_online.length - 1; i >= 0; i--) {
for (var i = svglines_online.length - 1; i >= 0; i--) {