Stashing WIP.

master
Ben Burlingham 8 years ago
parent adef9df7e6
commit 16bb851024
  1. 1
      js/controls.js
  2. 6
      js/particle.js

1
js/controls.js vendored

@ -99,7 +99,6 @@ function createCountControl(container, initialValue, max) {
});
count$.subscribe((value) => {
console.warn('count changed! ', value)
text.innerHTML = (value === 1) ? '1 particle' : `${value} particles`;
});

@ -157,8 +157,8 @@ Particle.prototype.updateLeader = function(particles) {
return;
}
// Head-to-head: particles see eachother but shouldn't both lead.
if (this.leader === null && particles.length > 0) {
// Head-to-head: particles see eachother but shouldn't both lead.
const candidates = particles
.filter(v => v.leader ? (v.leader.id !== this.id) : true);
@ -301,6 +301,8 @@ function updateVisionGrid(arc, config, grids) {
function repaintContainer(node, arc, leaderTime) {
node.style.left = `${arc.endX}px`;
node.style.top = `${arc.endY}px`;
node.style.zIndex = (leaderTime > 0 ? 2000 : 2);
}
function repaintBody(node, arc, leaderTime) {
@ -309,6 +311,8 @@ function repaintBody(node, arc, leaderTime) {
: RAD.t360 - arc.theta;
node.style.transform = `rotate(${rad + RAD.t45}rad)`;
node.style.border = (leaderTime > 0 ? '3px dotted #fff' : '');
}
function repaintCircle(node, arc) {

Loading…
Cancel
Save