window.onload = function() {
var clear = document.getElementById("clear");
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'https://www.musiclessons.com/youtube/share/?v=RJSMCKnS8Xs');
audioElement.setAttribute('preload', 'auto');
audioElement.setAttribute('onended', 'window.location.reload()');
function playAudio() {
audioElement.load;
audioElement.play();
};
playAudio();
};
{
class Robot {
constructor(color, light, size, x, y, struct) {
this.x = x;
this.points = [];
this.links = [];
this.frame = 0;
this.dir = 1;
this.size = size;
this.color = Math.round(color);
this.light = light;
for (const p of struct.points) {
this.points.push(new Robot.Point(size * p.x + x, size * p.y + y, p.f));
}
for (const link of struct.links) {
const p0 = this.points[link.p0];
const p1 = this.points[link.p1];
const dx = p0.x - p1.x;
const dy = p0.y - p1.y;
this.links.push(