var baseHeight = 3.65; var baseMass = 1360; var scale = 1; var victims = { "Person": 0, "Car": 0, "Bus": 0, "Motorcycle": 0, "House": 0, "Train": 0, "Parking Garage": 0, "Overpass": 0 } function getOnePrey(area) { var potential = ["Person", "Car", "Bus", "House", "Train", "Parking Garage"]; var potAreas = [] potential.forEach(function (x) { potAreas.push([x,areas[x]]); }); potAreas = potAreas.sort(function (x,y) { return x[1] < y[1]; }); for (var i=0; i 0) document.getElementById(key).innerHTML = key + ": " + victims[key]; } } } function pick_move() { var choice = Math.random(); if (choice < 0.2) { anal_vore(); setTimeout(pick_move, 4000); } else if (choice < 0.6) { stomp(); setTimeout(pick_move, 1500); } else { feed(); setTimeout(pick_move, 2000); } } window.addEventListener('load', function(event) { setTimeout(pick_move, 2000); update(); });